Add dune benchmark aliases (@bench-fast, @bench-full)#2392
Closed
cuihtlauac wants to merge 7 commits intomirage:eiofrom
Closed
Add dune benchmark aliases (@bench-fast, @bench-full)#2392cuihtlauac wants to merge 7 commits intomirage:eiofrom
cuihtlauac wants to merge 7 commits intomirage:eiofrom
Conversation
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>
9069ffa to
59c3dd0
Compare
- 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>
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.
Summary
dune build @bench-fastfor quick validation benchmarksdune build @bench-fullfor full production benchmarks_metrics/directory (persists acrossdune clean)bench/README.mddocumenting the benchmark suiteBenchmarks included
Test plan
dune build @bench-fastruns all benchmarks with reduced parametersdune build @bench-fullruns all benchmarks with production parameters_metrics/afterdune clean🤖 Generated with Claude Code