Optimize CI#1642
Open
orizi wants to merge 3 commits into
Open
Conversation
The macOS test job had no Swatinem/rust-cache step, so it recompiled the entire workspace from scratch on every run (~13m of cold compile on runners that cost ~10x the Linux ones). Add the cache step, matching the Linux job. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The dockerfile job ran `docker build .` with no caching, so the full release-LTO build of the workspace re-ran from scratch every time (~32m). Plain layer caching wouldn't help: `COPY . ` precedes `make deps`/`make build`, so any source change busts every layer after it. Instead, mount the cargo registry/git and target dirs as BuildKit cache mounts in the Dockerfile (incremental compile, contents kept out of the final image), and persist them across ephemeral runners via actions/cache + buildkit-cache-dance. The first run is cold; subsequent runs reuse the build cache. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Benchmarking resultsBenchmark for program
|
| Command | Mean [s] | Min [s] | Max [s] | Relative |
|---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
10.521 ± 0.040 | 10.430 | 10.566 | 5.92 ± 0.04 |
cairo-native (embedded AOT) |
1.779 ± 0.009 | 1.767 | 1.798 | 1.00 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
1.799 ± 0.017 | 1.782 | 1.829 | 1.01 ± 0.01 |
Benchmark for program dict_snapshot
Open benchmarks
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
527.1 ± 3.5 | 521.3 | 533.7 | 1.00 |
cairo-native (embedded AOT) |
1590.3 ± 6.0 | 1583.3 | 1599.0 | 3.02 ± 0.02 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
1626.5 ± 12.2 | 1609.5 | 1641.9 | 3.09 ± 0.03 |
Benchmark for program factorial_2M
Open benchmarks
| Command | Mean [s] | Min [s] | Max [s] | Relative |
|---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
4.705 ± 0.066 | 4.652 | 4.877 | 2.18 ± 0.04 |
cairo-native (embedded AOT) |
2.167 ± 0.063 | 2.099 | 2.281 | 1.01 ± 0.03 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
2.154 ± 0.031 | 2.122 | 2.210 | 1.00 |
Benchmark for program fib_2M
Open benchmarks
| Command | Mean [s] | Min [s] | Max [s] | Relative |
|---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
4.621 ± 0.087 | 4.551 | 4.822 | 2.89 ± 0.06 |
cairo-native (embedded AOT) |
1.600 ± 0.006 | 1.589 | 1.611 | 1.00 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
1.625 ± 0.006 | 1.615 | 1.633 | 1.02 ± 0.01 |
Benchmark for program linear_search
Open benchmarks
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
567.4 ± 3.8 | 564.6 | 574.6 | 1.00 |
cairo-native (embedded AOT) |
1639.4 ± 28.0 | 1618.5 | 1713.8 | 2.89 ± 0.05 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
1666.1 ± 18.7 | 1641.7 | 1707.6 | 2.94 ± 0.04 |
Benchmark for program logistic_map
Open benchmarks
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
482.9 ± 4.1 | 477.1 | 490.4 | 1.00 |
cairo-native (embedded AOT) |
1801.0 ± 65.3 | 1762.8 | 1983.9 | 3.73 ± 0.14 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
1915.2 ± 17.1 | 1885.9 | 1943.3 | 3.97 ± 0.05 |
Benchmark results Main vs HEAD.Base
Head
Base
Head
Base
Head
Base
Head
Base
Head
Base
Head
|
- unused-deps: cargo-machete only parses Cargo manifests, so it needs neither LLVM nor a compiled workspace. Remove the LLVM install/repo steps and env (also one fewer apt.llvm.org dependency to flake). - test: replace `apt-get update && apt-get upgrade -y` with just `apt-get update`; the job only needs the pinned LLVM-19 packages, not a full system upgrade (~41s).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Optimizing CI
Making CI faster using caching.
Introduces Breaking Changes?
No.