only store version of packages during load time when generating sysimage #46738
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.
I am looking at the number of stat calls during code loading (precompilation). One somewhat significant source of these is the lookup of the
version
field in the project file of packages (added in #44318) that happens as soon as a package is loaded. Due to the way the precompilation process work (IIUC), the number of these lookup scales quadratically with the depth of the dependency tree of a package.This PR changes it so that the lookup only happens when a call to
pkgversion
actually requests the version. An exception is when a sysimage is generated (for example from PackageCompiler) because then we want to also store the version to support the functionality in JuliaLang/Pkg.jl#3002.The script I am using to measure the number of stat calls is:
executed in an environment with only
GR_jll
installed. The results areThis may not seem like a huge reduction but further work on #46690 brings the baseline down heavily where this absolute difference is quite significant.