Repository navigation
perf: drop the precompile workload and run the package interpreted - #314
Merged
Merged
Conversation
The workload from #309 cached about 4,400 specializations, most of them Base methods, and verifying their backedges made DocStringExtensions take 33 ms to load where 0.10.0 took 4 ms. PrecompileTools also pulled in Preferences, TOML and Dates. Each dependent package paid that on every load, while the gain went only to sessions that render a docstring. Without the workload the first render took 1 s. From Julia 1.6 the module now sets `compile=min optimize=0`, keeping inference on so the type stability checks still hold. Interpreted code costs nothing to compile, but a closure passed to a Base function such as `map`, `filter`, `sort!` or a comprehension compiles a new specialization of that function. So the render path uses loops, and `methodgroups` groups by hand and sorts with `insertion_sort!`, replacing `groupby` and two `sort!` calls. The first render now takes about 0.19 s and loading about 4 ms. Closes #313
…sures `optimize=0` changed neither load time, first render nor the CImGui.jl docs build, so the module sets `compile=min` alone. A trace of the first render across every abbreviation still showed Base compiling for DSE: - `ComposedFunction` calls in `INSTANCES` and `SUBTYPES` - closures on the signature and name-list paths, such as `collapse_defaults` and `print_name_list` - `format(::ModuleImports)` itself, which Julia compiles because it holds a `ccall` Those are loops now, and each `ccall` sits in a function of its own. The first render of every abbreviation drops from 309 ms to 170 ms on nightly. `AGENTS.md` records the rule so new code keeps to it.
MichaelHatherly
marked this pull request as ready for review
October 21, 2026 11:19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Drop the #309 precompile workload, which slowed loading of every dependent package, and run the package interpreted from Julia 1.6. Closes #313.