Skip to content

Conversation

roberto-bayardo
Copy link
Collaborator

No description provided.

@roberto-bayardo roberto-bayardo requested a review from Copilot May 27, 2025 17:57
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request introduces a new benchmark for non-MMR leaf updates in the mem::mmr module.

  • A new benchmark function (bench_update) is added to simulate random MMR leaf updates and measure performance for various input sizes.
  • The benchmark is integrated into the Criterion test harness, and the corresponding module is included in the benchmark suite.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
storage/src/mmr/benches/update.rs Added benchmark function to measure non-MMR leaf updates performance.
storage/src/mmr/benches/bench.rs Included the update benchmark in the Criterion main entry point.
Comments suppressed due to low confidence (1)

storage/src/mmr/benches/update.rs:21

  • [nitpick] The variable 'h' is redefined on line 21, which may cause ambiguity. Consider renaming one of these variables (e.g., original_hasher and wrapped_hasher) for improved clarity.
let mut h = Standard::new(&mut h);

@roberto-bayardo roberto-bayardo force-pushed the tweak-mem-mmr-update branch 2 times, most recently from 07613fc to 58c2f6c Compare May 27, 2025 18:01
@commonwarexyz commonwarexyz deleted a comment from Copilot AI May 27, 2025
@roberto-bayardo roberto-bayardo marked this pull request as ready for review May 27, 2025 18:06
/// Benchmark the performance of randomly updating leaves in an MMR.
fn bench_update(c: &mut Criterion) {
let cfg = Config::default();
let runner = tokio::Runner::new(cfg.clone());
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think you need a clone on cfg here?

(Reviewing on mobile and apologize if I'm missing a line)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

correct, removed.

@patrick-ogrady patrick-ogrady merged commit af8b411 into main May 28, 2025
15 checks passed
@patrick-ogrady patrick-ogrady deleted the tweak-mem-mmr-update branch May 28, 2025 21:13
@codecov
Copy link

codecov bot commented May 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.79%. Comparing base (2efe85f) to head (ba0ab87).
Report is 7 commits behind head on main.

@@           Coverage Diff           @@
##             main    #1001   +/-   ##
=======================================
  Coverage   90.79%   90.79%           
=======================================
  Files         190      190           
  Lines       52630    52632    +2     
=======================================
+ Hits        47787    47789    +2     
  Misses       4843     4843           

see 5 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2efe85f...ba0ab87. Read the comment docs.

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

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.

2 participants