Skip to content

README.md: Add information from blog, reference PkgCacheInspector #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,30 @@ To learn how to use PrecompileTools, see the [documentation](https://JuliaLang.g

## PrecompileTools and PackageCompiler

Particularly on Julia 1.9 and higher, PrecompileTools allows dramatic reduction in "time to first execution" (TTFX).
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](https://github.com/JuliaLang/PackageCompiler.jl).

Nevertheless, the two are not identical:

- only PrecompileTools can be used by *package 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 the [Julia 1.9 highlights blog post](https://julialang.org/blog/2023/04/julia-1.9-highlights/#caching_of_native_code).

## Inspecting the package precompile files

[PkgCacheInspector](https://github.com/timholy/PkgCacheInspector.jl) provides insight about what's stored in Julia's package precompile files.

## History (origins as SnoopPrecompile)

PrecompileTools is the successor to [SnoopPrecompile](https://github.com/timholy/SnoopCompile.jl/tree/master/SnoopPrecompile).
Expand Down