Skip to content

feat: add cairo-to-cache and cache-to-sierra compile benchmarks#9857

Merged
orizi merged 1 commit intomainfrom
orizi/04-19-feat_add_cairo-to-cache_and_cache-to-sierra_compile_benchmarks
Apr 20, 2026
Merged

feat: add cairo-to-cache and cache-to-sierra compile benchmarks#9857
orizi merged 1 commit intomainfrom
orizi/04-19-feat_add_cairo-to-cache_and_cache-to-sierra_compile_benchmarks

Conversation

@orizi
Copy link
Copy Markdown
Collaborator

@orizi orizi commented Apr 20, 2026

TL;DR

Added two new benchmarks to measure the performance of the lowering cache pipeline for Cairo compilation.

What changed?

Two new benchmark functions were added to the compile benchmark suite:

  • fib: cairo-to-cache — measures the time to compile Cairo source to a serialized lowering cache (bytes), without Sierra generation.
  • fib: cache-to-sierra — measures the time to generate Sierra from a pre-compiled lowering cache, isolating the cost of Sierra generation from the full compilation pipeline.

How to test?

Run the compile benchmarks:

cargo bench --bench compile

The two new benchmark entries (fib: cairo-to-cache and fib: cache-to-sierra) will appear in the output alongside the existing benchmarks.

Why make this change?

The lowering cache splits the compilation pipeline into two distinct phases. These benchmarks allow measuring each phase independently, making it possible to quantify the performance impact of caching lowering results and to track regressions or improvements in each phase separately.

@reviewable-StarkWare
Copy link
Copy Markdown

This change is Reviewable

Copy link
Copy Markdown
Collaborator Author

orizi commented Apr 20, 2026

@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 20, 2026

PR Summary

Low Risk
Low risk: changes are limited to benchmark code and add no production-path logic, though they exercise new lowering-cache wiring that could affect benchmark stability/perf comparisons if misconfigured.

Overview
Adds two new compile benchmarks to split the pipeline around the lowering cache: fib: cairo-to-cache measures generating/serializing the lowering cache bytes, and fib: cache-to-sierra measures Sierra generation when a precomputed cache is injected via crate config.

Updates the benchmark harness to use generate_crate_cache, virtual cache blobs, and compile_prepared_db_program so the new phases can be timed independently alongside existing compile/diagnostics/testing benches.

Reviewed by Cursor Bugbot for commit 2c56d92. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2c56d92706

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/benches/compile.rs
Copy link
Copy Markdown
Collaborator

@TomerStarkware TomerStarkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

@TomerStarkware reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on eytan-starkware and orizi).

@orizi orizi force-pushed the orizi/04-19-feat_add_cairo-to-testing_benchmark branch from bc1be30 to 5852243 Compare April 20, 2026 11:52
@orizi orizi force-pushed the orizi/04-19-feat_add_cairo-to-cache_and_cache-to-sierra_compile_benchmarks branch from 2c56d92 to 219c28e Compare April 20, 2026 11:52
@orizi orizi changed the base branch from orizi/04-19-feat_add_cairo-to-testing_benchmark to graphite-base/9857 April 20, 2026 13:44
@orizi orizi force-pushed the graphite-base/9857 branch from 5852243 to 6035420 Compare April 20, 2026 13:45
@orizi orizi force-pushed the orizi/04-19-feat_add_cairo-to-cache_and_cache-to-sierra_compile_benchmarks branch from 219c28e to 161110e Compare April 20, 2026 13:45
@orizi orizi changed the base branch from graphite-base/9857 to main April 20, 2026 13:45
@orizi orizi enabled auto-merge April 20, 2026 13:45
@orizi orizi added this pull request to the merge queue Apr 20, 2026
Merged via the queue into main with commit e660fef Apr 20, 2026
104 checks passed
@orizi orizi deleted the orizi/04-19-feat_add_cairo-to-cache_and_cache-to-sierra_compile_benchmarks branch April 20, 2026 15:50
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.

3 participants