Every shard currently runs julia-buildpkg for itself, so an N-shard run instantiates and precompiles the same project N times. The obvious fix is to build once and hand the result to the children.
The distinction that decides whether this is worth it
Redundant precompilation across shards is concurrent. Eight shards each spending 50 s precompiling costs 400 runner-seconds but only 50 s of wall clock. Building once and distributing serialises that work:
today: precompile ∥ precompile ∥ … → test = precompile + max_bin
build-once: build → distribute → test = build + download + max_bin
So on wall clock this is neutral at best and usually slightly worse. On runner-seconds it is a large win — Nx precompile becomes 1x.
Writing this down because it is the kind of claim that otherwise gets argued from intuition each time it comes up. If the goal is a faster PR, this is not the lever. If the goal is cheaper CI, it is a good one.
Where it does buy wall clock
When shards start staggered — see #8 — a late starter that can restore a prebuilt depot is cheap instead of paying full startup. Build-once and work-stealing compose; neither substitutes for the other.
Options
| approach |
effect |
cost |
| Prebuild job uploading the depot as an artifact, shards restore it |
Nx precompile becomes 1x |
serialises the build; a large artifact transferred N times |
julia-actions/cache with an explicit depot input |
same cache, one location |
still restores per job |
| Sysimage via PackageCompiler |
biggest cut to per-shard startup |
slow to build, and must match the --check-bounds setting or Julia will not use it (see #10) |
| Persistent depot on a self-hosted pool |
already does this |
why the private repos' fixed cost differs from the hosted ones |
Prerequisite
Do not start here. #10 has to establish where the fixed cost actually goes first — there is a live hypothesis there that --check-bounds=yes makes the test step recompile a stack julia-buildpkg already precompiled under different flags. If that holds, it is a larger lever than distributing a build, and cheaper to act on.
TODO
Every shard currently runs
julia-buildpkgfor itself, so an N-shard run instantiates and precompiles the same project N times. The obvious fix is to build once and hand the result to the children.The distinction that decides whether this is worth it
Redundant precompilation across shards is concurrent. Eight shards each spending 50 s precompiling costs 400 runner-seconds but only 50 s of wall clock. Building once and distributing serialises that work:
So on wall clock this is neutral at best and usually slightly worse. On runner-seconds it is a large win — Nx precompile becomes 1x.
Writing this down because it is the kind of claim that otherwise gets argued from intuition each time it comes up. If the goal is a faster PR, this is not the lever. If the goal is cheaper CI, it is a good one.
Where it does buy wall clock
When shards start staggered — see #8 — a late starter that can restore a prebuilt depot is cheap instead of paying full startup. Build-once and work-stealing compose; neither substitutes for the other.
Options
julia-actions/cachewith an explicitdepotinput--check-boundssetting or Julia will not use it (see #10)Prerequisite
Do not start here. #10 has to establish where the fixed cost actually goes first — there is a live hypothesis there that
--check-bounds=yesmakes the test step recompile a stackjulia-buildpkgalready precompiled under different flags. If that holds, it is a larger lever than distributing a build, and cheaper to act on.TODO