-
Notifications
You must be signed in to change notification settings - Fork 481
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
Add TimerOutput to analyze doc build times #2521
base: master
Are you sure you want to change the base?
Conversation
I like the idea! |
This seems pretty great! I need to find some time to go through the implementation, but generally I don't think I have any reservations about it (except the global state). This is looking pretty good already! |
Yeah maybe scoped values would be appropriate here? Although they might be too new for Documenter, that's why I didn't try them. Another question I had was if the implementation could be pushed outside of all the runner functions. But I needed some info that was already available inside, like line numbers, and I didn't want to duplicate that. Maybe there's a trick how the timing code can be placed more elegantly. |
I've run this branch on my own documentation. Everything seems to build correctly and the timing output is also very informative. I will mention however that the docs I ran don't have any doctesting so I can't speak if that works or not with this branch. My only thought was that since the timing table output can get quite large, maybe there should be an option to disable the benchmarking or to collapse the table output to be by page only. |
I would probably make it opt-in with an option in |
A simple api that makes it less global could be to pass in a I thought some useful post processing might be to remove all code blocks under some threshold of either absolute time or percentage of page. Because you're going to care about the 20% of code using 80% of the time. |
The way I have it refactored now is that there are two levels (aside from no timings) and with full timings you get timings for every block, for the other one just for every page. makedocs(;
sitename = "Some Site",
timings = Documenter.BasicTimings,
)
makedocs(;
sitename = "Some Site",
timings = Documenter.FullTimings,
)
I was already halfway started to make a more complicated system where you can filter even more and come up with custom selections, but then I thought that's probably way overkill. |
Makie has switched back to Documenter(Vitepress), so I was reminded of the issue that I have no insight into the build time. We have tons of examples that can also be rather heavy, so my idea was to list all of them sorted by time using TimerOutputs.jl. This PR is for now just a draft of how this could look.
Here's an example output from a reduced run of the Makie docs, where one can see that the intervalslider page needs half the time due to a long video being rendered. (The lines can usually be shown but I'm mostly using a modified example block where the matching of the code back to the file breaks)