-
Notifications
You must be signed in to change notification settings - Fork 487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extremely long runtimes of ExpandTemplates with Julia > 1.1 #1261
Comments
Update: It seems I could identify the reason: generated functions! The aforementioned file has two of them. A makedocs run for just this file takes 88s. If I comment those generated functions it only takes 16s. |
I refactored my code and got rid of all the I Julia v1.1: Seems to be a warmup issue, for the second run of Julia v1.1: |
I am experiencing the same problem with Julia 1.4.0, although I do not have
Redoing the test two more times, the backtrace was always the same: the process seems to hang at line 702 in |
In my cases, Documenter always finishes, but a run that takes one or two minutes with Julia v1.1 can take up to one or two hours on Julia v1.2 - v1.4. |
After some debugging I realized there was a mistake in my part: because of a typo, the code in a I'm sorry for the spam! |
I just started experiencing a similar problem with the This may be related to |
What was the difference between those runs? |
Hi, thanks for asking. The short version is that, in a fairly complex PR, we changed the types behind a data structure based on I thought I'd also post here because it sounds like someone else had a similar problem. @michakraus, if don't mind my asking, did you ever get any insight into what caused your slowdown, or was the problem simply resolved by your removing |
The latter, unfortunately. I wasn't able to pin this down further. But indeed, refactoring our code, removing many of the generated functions, sped up the doc build quite dramatically. Not to what it was with Julia v1.1, but close enough. |
Ah ok, thanks for explaining. |
It would be very useful if someone could push a branch with just a subset of the documentation that still shows the slow behavior, perhaps just a single page, with a few docstrings. |
Thanks, I made a branch with a small subset of the docs. The build now takes 10 min, longer than the original full build used to take. What's even stranger is that the included docs are disjoint from the changes that seem to have caused the slowdown. (In particular, none of the |
We're also experiencing long expanding templates over at ClimateMachine.jl. It takes about 6 minutes for us. |
@charleskawczynski, I instrumented Documenter a bit and the majority of time is spent in: and https://github.com/CliMA/ClimateMachine.jl/blob/master/docs/src/HowToGuides/Common/Thermodynamics.md taking 112s and 55s respectively. |
Hm, that leaves about 3 minutes. That's still pretty long, no? Those files taking half the time makes sense, though. Thanks for looking into that. |
On my machine, it was not really 6 minutes and those took the majority of that time. If you want to measure it further you can time over Documenter.jl/src/Expanders.jl Lines 37 to 45 in 97f1a9f
and for more fine-grained timings over Documenter.jl/src/Expanders.jl Lines 41 to 43 in 97f1a9f
|
Hey. I may encountered a similar issue on a package I'm developing in Julia v1.7.2. It's not published yet, so I can't share it, though. When I change the activated packages when calling Calling it like this will not finish (I canceled after 55 minutes) julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
julia --project=docs/ docs/make.jl In this case my But removing julia -e 'using Pkg; Pkg.add(name="Documenter", version="0.27"); Pkg.activate(pwd()); include("docs/make.jl")' succeeds in around 1:45 minutes. Also when remove all the |
I was also facing insanely long times on I was wondering whether the build info could just include some information of how long various pages took (following your timing suggestion @KristofferC). For example julia> include("docs/make.jl")
[ Info: SetupBuildDirectory: setting up build directory.
[ Info: Doctest: running doctests.
[ Info: ExpandTemplates: expanding markdown templates.
[ Info: page1.md built in 2s.
[ Info: page2.md built in 240s.
[ Info: page3.md built in 3s.
... That will probably help people to better identify what's going on during the documentation build? |
I found that generating documentation for my library GeometricIntegrators.jl went from tens of seconds with Julia v1.1 to about an hour with Julia v1.3.
The main reason seems to be the step
ExpandTemplates: expanding markdown templates
. Everything else still runs reasonably fast. I was able to isolate a few files in the library which are particularly problematic, but I cannot see any decisive differences to other files, which are processed much quicker. For one of these files the "ExpandTemplates" time rose from 1-2s to 75-80s going from Julia v1.1 to v1.3, changing nothing else.It is kind of hard to provide a MWS as the problematic files depend on many other modules in the library. If someone wants to look into this, I could, however, provide a branch with a minimal doc setup for testing purposes. However, maybe this is a somewhat known problem and there is an immediate explanation.
I tested just now with Documenter v0.24.6 but this problem seems to have existed for some time. So far, I just used Julia v1.1 to generate documentation, but now I use Julia v1.3 features in the library, so this is not an option anymore.
Addendum: For most of the documentation I am using @autodocs, e.g., for the aforementioned file,
but usually without the Pages argument.
The text was updated successfully, but these errors were encountered: