Skip to content

Optimize CI#1642

Open
orizi wants to merge 3 commits into
mainfrom
orizi/06-11-opt_ci_cache_rust_build_artifacts_on_macos_test_job
Open

Optimize CI#1642
orizi wants to merge 3 commits into
mainfrom
orizi/06-11-opt_ci_cache_rust_build_artifacts_on_macos_test_job

Conversation

@orizi

@orizi orizi commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Optimizing CI

Making CI faster using caching.

Introduces Breaking Changes?

No.

orizi and others added 2 commits June 11, 2026 17:07
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>
@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown

Benchmarking results

Benchmark for program dict_insert

Open benchmarks
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

@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown

Benchmark results Main vs HEAD.

Base

Command Mean [s] Min [s] Max [s] Relative
base dict_insert.cairo (JIT) 1.808 ± 0.012 1.798 1.829 1.01 ± 0.01
base dict_insert.cairo (AOT) 1.787 ± 0.018 1.771 1.836 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head dict_insert.cairo (JIT) 1.924 ± 0.025 1.875 1.950 1.00 ± 0.03
head dict_insert.cairo (AOT) 1.921 ± 0.046 1.848 2.021 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base dict_snapshot.cairo (JIT) 1.634 ± 0.005 1.624 1.642 1.02 ± 0.01
base dict_snapshot.cairo (AOT) 1.599 ± 0.010 1.586 1.616 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head dict_snapshot.cairo (JIT) 1.769 ± 0.038 1.713 1.834 1.00
head dict_snapshot.cairo (AOT) 1.796 ± 0.060 1.709 1.875 1.01 ± 0.04

Base

Command Mean [s] Min [s] Max [s] Relative
base factorial_2M.cairo (JIT) 2.142 ± 0.021 2.114 2.182 1.01 ± 0.01
base factorial_2M.cairo (AOT) 2.116 ± 0.017 2.092 2.150 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head factorial_2M.cairo (JIT) 2.277 ± 0.019 2.238 2.302 1.01 ± 0.01
head factorial_2M.cairo (AOT) 2.245 ± 0.021 2.200 2.279 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base fib_2M.cairo (JIT) 1.663 ± 0.018 1.642 1.701 1.00
base fib_2M.cairo (AOT) 1.712 ± 0.030 1.677 1.768 1.03 ± 0.02

Head

Command Mean [s] Min [s] Max [s] Relative
head fib_2M.cairo (JIT) 1.836 ± 0.024 1.802 1.880 1.04 ± 0.02
head fib_2M.cairo (AOT) 1.759 ± 0.021 1.734 1.793 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base linear_search.cairo (JIT) 1.758 ± 0.043 1.724 1.858 1.00 ± 0.03
base linear_search.cairo (AOT) 1.751 ± 0.022 1.719 1.790 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head linear_search.cairo (JIT) 1.707 ± 0.023 1.682 1.745 1.01 ± 0.03
head linear_search.cairo (AOT) 1.695 ± 0.040 1.653 1.749 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base logistic_map.cairo (JIT) 1.998 ± 0.026 1.964 2.052 1.08 ± 0.02
base logistic_map.cairo (AOT) 1.859 ± 0.016 1.840 1.899 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head logistic_map.cairo (JIT) 2.009 ± 0.045 1.925 2.079 1.04 ± 0.02
head logistic_map.cairo (AOT) 1.932 ± 0.015 1.902 1.948 1.00

- 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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant