Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork15
Reduce time-to-first-execution of Julia code
License
JuliaLang/PrecompileTools.jl
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
PrecompileTools allows you to reduce the latency of the first execution of Julia code.It is applicable for package developers and for "ordinary users" in their personal workflows.
To learn how to use PrecompileTools, see thedocumentation.
Particularly on Julia 1.9 and higher, PrecompileTools allows dramatic reduction in "time to first execution" (TTFX) without the need for user-customization.In this respect, it shares goals with (and performs similarly to)PackageCompiler.
Nevertheless, the two are not identical:
- only PrecompileTools can be used bypackage developers to ensure a better out-of-box experience for your users
- only PrecompileTools allows you to update your packages without needing to rebuild Julia
- only PackageCompiler dramatically speeds up loading time (i.e.,
using ...
) for all the packages
Here is a table summarizing the information.
Task | Julia 1.9 + PrecompileTools | PackageCompiler |
---|---|---|
Developers can reduce out-of-box TTFX for their users | ✔️ | ❌ |
Users can reduce TTFX for custom tasks | ✔️ | ✔️ |
Packages can be updated without rebuilding system image | ✔️ | ❌ |
Reduces time to load (TTL) | ❌ | ✔️ |
The difference in time to load arises because the system image can safely skip all the code-validation checks that are necessary when loading packages. Examples of the reduction in time to first execution and time to load can be found in theJulia 1.9 highlights blog post.
PkgCacheInspector provides insight about what's stored in Julia's package precompile files.
PrecompileTools is the successor toSnoopPrecompile.PrecompileTools differs in naming and in how one disables precompilation, but is otherwise a drop-in replacement.
This new package was created for several reasons:
- PrecompileTools has become (directly or indirectly) a dependency of much of the Julia ecosystem, a trend that seems likely to grow with time.Therefore, this package is now hosted in the JuliaLang GitHub organization.
- As Julia's own stdlibs migrate to become independently updateable (true for DelimitedFiles in Julia 1.9, with others anticipated for Julia 1.10), several of them would like to use PrecompileTools for high-quality precompilation. That requires making PrecompileTools its own "upgradable stdlib."
- This package introduces theuse of Preferences to make packages more independent of one another. Since this would have been a breaking change, it seemed like a good opportunity to fix other issues, too.
For more information and discussion, see theDiscourse announcement post.
About
Reduce time-to-first-execution of Julia code
Resources
License
Code of conduct
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors14
Uh oh!
There was an error while loading.Please reload this page.