Conversation
This seems kind of crazy numbers... A no-op |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1127 +/- ##
==========================================
- Coverage 84.11% 74.32% -9.79%
==========================================
Files 3 3
Lines 900 892 -8
==========================================
- Hits 757 663 -94
- Misses 143 229 +86 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Oh, I'll check this again and come back with the results. |
`ensurecompiled` only has to leave a cache that the sysimage build can read. That build runs with `--pkgimages=no`, so it needs the source-only cache, and loading the packages writes it. `Pkg.precompile()` reaches the same state, but under `--pkgimages=no` Pkg's own native code is not available, so the first call in a process compiles Pkg's precompile path from IR. `ensurecompiled` starts a fresh process every build, so it pays that every time. On `examples/MyApp` with a warm depot of 381 packages, all with `--pkgimages=no`: `using Pkg; Pkg.precompile()` takes 28.7 s and 26.8 s on repeat, `import MyApp` takes 0.6 s and 0.6 s. In one process the first `Pkg.precompile()` costs 21.1 s and the second 0.0 s. Assisted-by: Claude Code (Opus 5)
75183e6 to
0101903
Compare
Disclaimer: the following is an AI response which I reviewed and verified. I admit that I'm not fully sure if we are correct and this really is an issue to be fixed. If you still believe we are on the wrong track here then let me know and I'll close this PR. Edited AI response follows: Fair challenge, the explanation was wrong but the number holds. It is not a depot scan because a scan would repeat. Three calls in one process with --pkgimages=no: 21.06 s, then 0.0 s, then 0.0 s. Under that flag Pkg's native code is not available, so the first call compiles Pkg's own precompile path from IR. using Pkg alone is 0.5 s, so it is not the loading either. With pkgimages the same call is 0.4 s. import never enters that machinery — loading is Base's job and Base has its native code in the sysimage. On examples/MyApp, --pkgimages=no, warm depot of 381 packages: Pkg.precompile() 28.7 s then 26.8 s; import MyApp 0.6 s then 0.6 s. ensurecompiled starts a fresh process per build, so it pays that build. I have fixed the comment and the description, which both said "scans the depot". These are the measurements which support the claim: |
|
#1131 should be the better version of this, feel free to try it out |
|
I tried your version and it works as expected. You can close this PR once the other one gets merged in. Thank you! |
ensurecompiledonly has to leave a cache that the sysimage build can read. That build runs with--pkgimages=no, so it needs the source-only cache, and loading the packages writes it.Pkg.precompile()gets there too, but it scans the depot first and rejects every pkgimage-backed cache under that flag. The cost then tracks the depot, not the project: 45.6 s on a depot of 15 324 files, against 0.45 s with pkgimages, for a call that precompiled nothing.Assisted-by: Claude Code (Opus 5)