Skip to content

chore: Organize serialization benchmarks#3151

Merged
aborgna-q merged 3 commits into
mainfrom
ab/bench-without-zstd
Jul 13, 2026
Merged

chore: Organize serialization benchmarks#3151
aborgna-q merged 3 commits into
mainfrom
ab/bench-without-zstd

Conversation

@aborgna-q

@aborgna-q aborgna-q commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Cleans up the serialization benchmarks

  • Moves the serialization-specific benchmarks from ::benchmarks::hugr to a new ::benchmarks::serialization module.

  • Drops benchmarks for deprecated json format

  • Adds SExpression envelope benchmarks

  • Disables zstd in the model encoding benchmarks

  • Adds benchmarks for the envelope formats without the extra extension encoding.

  • Adds a real-world t_factory example hugr, in addition to the syntetic ones.

  • drive-by: Moves the common example hugrs from benchmarks::hugr::examples to ::examples.

@aborgna-q
aborgna-q requested a review from a team as a code owner July 10, 2026 14:29
@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.33%. Comparing base (9f09481) to head (af24240).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3151   +/-   ##
=======================================
  Coverage   81.33%   81.33%           
=======================================
  Files         242      242           
  Lines       46951    46951           
  Branches    40636    40636           
=======================================
  Hits        38189    38189           
  Misses       6769     6769           
  Partials     1993     1993           
Flag Coverage Δ
python 89.48% <ø> (ø)
rust 80.07% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@maximilianruesch maximilianruesch left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Gotta love some new benchmarks!

Comment thread test_files/guppy_examples/t_factory.py Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do I go right in seeing that this change (and the one in subgraph.rs) is largely disconnected from the serialisation changes? If they are completely disconnected, I would prefer them as separate PRs...

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I added the t factory example here. The rest is just renaming the file to a more shared space.

I don't think it's worth splitting a PR just for that (listed it as drive-by in the PR).

Comment on lines +88 to +95
fn bench_serialization(c: &mut Criterion) {
bench_hugr(c, "t_factory", &t_factory());
bench_hugr(c, "simple_cfg", &simple_cfg_hugr());

for byte_size in [1024, 1024 * 1024] {
bench_hugr(c, &format!("big_hugr/{byte_size}"), &big_hugr(byte_size));
}
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What happened to the circuit based benchmarks?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I removed it, to balance a bit the number of new benchmars (this PR bumps the count from 33 to 45. The circuit ones would be 20 more.

The original idea for that test case was to see the asymptotic time grow for similar circuits of different sizes. Unfortunately codspeed doesn't have a way to visualize that nicely, so I don't think it was a good tradeoff against the extra CI time.

Comment thread hugr/benches/benchmarks/serialization.rs Outdated
@aborgna-q
aborgna-q requested a review from cqc-alec July 13, 2026 09:58
@aborgna-q
aborgna-q added this pull request to the merge queue Jul 13, 2026
Merged via the queue into main with commit 57c36fa Jul 13, 2026
31 checks passed
@aborgna-q
aborgna-q deleted the ab/bench-without-zstd branch July 13, 2026 10:30
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