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 the documentation.
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:
using ...) for all the packagesHere 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 the Julia 1.9 highlights blog post.
PkgCacheInspector provides insight about what's stored in Julia's package precompile files.
PrecompileTools is the successor to SnoopPrecompile. 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:
For more information and discussion, see the Discourse announcement post.
1,963 followers · starred Apr 2023
30 followers · starred Apr 2023
1,739 followers · starred May 2023
585 followers · starred Jul 2024
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 the documentation.
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:
using ...) for all the packagesHere 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 the Julia 1.9 highlights blog post.
PkgCacheInspector provides insight about what's stored in Julia's package precompile files.
PrecompileTools is the successor to SnoopPrecompile. 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:
For more information and discussion, see the Discourse announcement post.
1,963 followers · starred Apr 2023
30 followers · starred Apr 2023
1,739 followers · starred May 2023
585 followers · starred Jul 2024