Script: add profiling checkpoints to html()#2829
Script: add profiling checkpoints to html()#2829ascholerChemeketa wants to merge 1 commit intoPreTeXtBook:masterfrom
Conversation
|
Looking good visually. You didn't like the comment that equaled the function name? ;-) |
|
And shoulda said - thanks for breaking this out. |
|
I was confused by "profile.py" when I did a visual review. Do we have a module named "profile.py"? Or is it from some associated library? And why does it matter? I'll need to chase that down, I thought. How about "html.profile"? Yes, it is all in the Python, but it is also the HTML build being profiled. More consistent with names in use otherwise. Claude flagged this as well. That review coming next. Mostly nitpicking stuff, but maybe something you would like to react to. We have a developer's section in the Guide. Let's record the existence of this switch there somewhere with just a single sentence. Likely no great/obvious place, so don't sweat it. It'll get reorganized eventually. You can pile on new commits, if you keep documentation on the last one by itself, and I'll clean up. |
|
Thanks for breaking this out from #2329, much easier to evaluate independently. Clean and useful. A few observations: Stringparam naming: The param is Minor:
Otherwise looks good to merge once the naming question is settled. Claude Opus 4.6 acting as a review assistant for Rob Beezer |
|
How about I could see adding timestamp logging to other pathways and wanting to use the same flag to say "show me timing" while debugging. |
|
I like |
Pulled out from: #2329
This pull request adds a lightweight timing and profiling utility to the
pretext/lib/pretext.pymodule, enabling optional logging of elapsed time at key stages of the HTML build process. The main change is the introduction of aStopwatchclass and its integration into thehtml()function, allowing developers to profile and monitor build performance when needed.Profiling and Logging Enhancements:
Stopwatchclass for measuring and logging elapsed time between key events, with optional logging controlled by theprofile.pystring parameter. (pretext/lib/pretext.py)Stopwatchinto thehtml()function, adding time logs at major build steps such as loading publisher variables, placing Runestone services, copying managed directories, copying CSS/JS, running XSLT, and completing the build. (pretext/lib/pretext.py) [1] [2] [3] [4] [5]Dependency Update:
timemodule to support the new timing functionality. (pretext/lib/pretext.py)