Skip to content

Add dune benchmark aliases (@bench-fast, @bench-full)#2392

Closed
cuihtlauac wants to merge 7 commits intomirage:eiofrom
cuihtlauac:benchmarks
Closed

Add dune benchmark aliases (@bench-fast, @bench-full)#2392
cuihtlauac wants to merge 7 commits intomirage:eiofrom
cuihtlauac:benchmarks

Conversation

@cuihtlauac
Copy link

Summary

  • Add standardized benchmark infrastructure with dune aliases
  • dune build @bench-fast for quick validation benchmarks
  • dune build @bench-full for full production benchmarks
  • Results stored in project root _metrics/ directory (persists across dune clean)
  • Add bench/README.md documenting the benchmark suite

Benchmarks included

Benchmark Description
tree Tree operations (chains, large trees) with irmin-pack
bench-pack Commit/tree performance with irmin-pack backend
irmin-mem Commit/tree performance with in-memory backend
multicore Parallel tree operations (half/full diamond patterns)
hashset Fixed-size string set memory usage comparison

Test plan

  • dune build @bench-fast runs all benchmarks with reduced parameters
  • dune build @bench-full runs all benchmarks with production parameters
  • Results persist in _metrics/ after dune clean
  • Clean output with consistent "Results: " messages

🤖 Generated with Claude Code

@cuihtlauac cuihtlauac changed the base branch from main to eio January 27, 2026 12:23
cuihtlauac and others added 5 commits January 29, 2026 08:36
Add standardized benchmark infrastructure with dune aliases:
- `dune build @bench-fast` for quick validation
- `dune build @bench-full` for full benchmarks

Changes:
- Add benchmark rules to dune files for all benchmarks
- Store results in project root `_metrics/` (persists across dune clean)
- Suppress verbose debug output during benchmark runs
- Print consistent "Results: <path>" messages
- Add bench/README.md documenting the benchmark suite

Benchmarks included:
- tree: Tree operations with irmin-pack
- bench-pack: Commit/tree performance with irmin-pack
- irmin-mem: Commit/tree performance with in-memory backend
- multicore: Parallel tree operations (half/full diamond)
- hashset: Fixed-size string set memory comparison

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Optimize read operations by reusing a Cstruct buffer instead of
allocating a new one for each read. The buffer is stored in the
file handle and grown as needed.

This reduces allocation pressure in read-heavy workloads where the
Eio layer previously created a new Cstruct for every pread_exact call.

Also add profiling scripts (_bench/profile.sh and _bench/compare.sh)
to help identify performance bottlenecks and compare between branches.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
cuihtlauac and others added 2 commits January 29, 2026 09:08
- Remove (optional) from irmin-pack.unix: Since irmin-tezos depends on
  this library, it must always be built as part of irmin-pack installation

- Change benchmark rules package from irmin-tezos to irmin-test: The
  multicore benchmark executable depends on test_pack which depends on
  irmin-tezos, creating a circular dependency when building irmin-tezos

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The read buffer optimization introduced in commit 25c7c66 was not
thread-safe: multiple fibers could concurrently access and mutate
the shared read_buf field, causing data corruption in multicore tests.

This reverts to allocating a fresh Cstruct for each read operation,
which is safe for concurrent access.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@cuihtlauac cuihtlauac closed this Feb 10, 2026
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