Skip to content

test: add nns_vote_cascading benchmarks#371

Merged
maksymar merged 1 commit intomainfrom
maksym/nns
Jul 14, 2025
Merged

test: add nns_vote_cascading benchmarks#371
maksymar merged 1 commit intomainfrom
maksym/nns

Conversation

@maksymar
Copy link
Copy Markdown
Contributor

@maksymar maksymar commented Jul 14, 2025

This PR adds NNS related benchmarks.

Based on this code.

NNS benchmarks will be enabled in CI in follow-up PR, because they need to be present in main branch first.

@maksymar maksymar changed the title tests: add nns_vote_cascading benchmarks test: add nns_vote_cascading benchmarks Jul 14, 2025
@maksymar maksymar marked this pull request as ready for review July 14, 2025 10:02
@maksymar maksymar requested a review from a team as a code owner July 14, 2025 10:02
@maksymar maksymar requested a review from Copilot July 14, 2025 10:04
Copy link
Copy Markdown
Contributor

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 PR introduces NNS vote cascading benchmarks and supporting tests to the repository.

  • Adds unit tests for calculate_cascaded_votes covering various followee configurations and both storage backends.
  • Implements benchmark setup strategies (Centralized, SingleVote, Chain) with numerous #[bench] functions to measure performance.
  • Updates project configuration (Cargo.toml, canbench.yml) and adds a main binary entry point for NNS benchmarks.

Reviewed Changes

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

Show a summary per file
File Description
benchmarks/nns/src/nns_vote_cascading/tests.rs Added unit tests for vote cascading with Stable/Heap stores
benchmarks/nns/src/nns_vote_cascading/benches.rs Defined benchmark setup strategies and registered benches
benchmarks/nns/src/nns_vote_cascading.rs Implemented Vote, NeuronStore trait, stores, and logic
benchmarks/nns/src/main.rs Added empty main to register NNS benchmark binary
benchmarks/nns/canbench_results.yml Committed initial benchmark results
benchmarks/nns/canbench.yml Added Canbench build and path configurations
benchmarks/Cargo.toml Registered new nns binary for benchmarks
Comments suppressed due to low confidence (2)

benchmarks/nns/src/nns_vote_cascading/benches.rs:27

  • The parameter name 'stratygy' is misspelled; consider renaming it to 'strategy' for clarity.
    stratygy: SetUpStrategy,

benchmarks/nns/src/nns_vote_cascading/benches.rs:160

  • The parameter name 'stratygy' is misspelled here as well; update it to 'strategy' to match standard spelling.
fn bench_helper(neuron_store: &mut impl NeuronStore, stratygy: SetUpStrategy) -> BenchResult {

Comment thread benchmarks/nns/src/nns_vote_cascading/benches.rs
@github-actions
Copy link
Copy Markdown

canbench 🏋 (dir: ./benchmarks/vec) d64bc23 2025-07-14 10:05:48 UTC

./benchmarks/vec/canbench_results.yml is up to date
📦 canbench_results_vec.csv available in artifacts

---------------------------------------------------

Summary:
  instructions:
    status:   No significant changes 👍
    counts:   [total 16 | regressed 0 | improved 0 | new 0 | unchanged 16]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

  heap_increase:
    status:   No significant changes 👍
    counts:   [total 16 | regressed 0 | improved 0 | new 0 | unchanged 16]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

  stable_memory_increase:
    status:   No significant changes 👍
    counts:   [total 16 | regressed 0 | improved 0 | new 0 | unchanged 16]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

---------------------------------------------------
CSV results saved to canbench_results.csv

@github-actions
Copy link
Copy Markdown

canbench 🏋 (dir: ./benchmarks/memory_manager) d64bc23 2025-07-14 10:05:55 UTC

./benchmarks/memory_manager/canbench_results.yml is up to date
📦 canbench_results_memory-manager.csv available in artifacts

---------------------------------------------------

Summary:
  instructions:
    status:   No significant changes 👍
    counts:   [total 3 | regressed 0 | improved 0 | new 0 | unchanged 3]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

  heap_increase:
    status:   No significant changes 👍
    counts:   [total 3 | regressed 0 | improved 0 | new 0 | unchanged 3]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

  stable_memory_increase:
    status:   No significant changes 👍
    counts:   [total 3 | regressed 0 | improved 0 | new 0 | unchanged 3]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

---------------------------------------------------
CSV results saved to canbench_results.csv

@github-actions
Copy link
Copy Markdown

canbench 🏋 (dir: ./benchmarks/btreemap) d64bc23 2025-07-14 10:07:44 UTC

./benchmarks/btreemap/canbench_results.yml is up to date
📦 canbench_results_btreemap.csv available in artifacts

---------------------------------------------------

Summary:
  instructions:
    status:   No significant changes 👍
    counts:   [total 285 | regressed 0 | improved 0 | new 0 | unchanged 285]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

  heap_increase:
    status:   No significant changes 👍
    counts:   [total 285 | regressed 0 | improved 0 | new 0 | unchanged 285]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

  stable_memory_increase:
    status:   No significant changes 👍
    counts:   [total 285 | regressed 0 | improved 0 | new 0 | unchanged 285]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

---------------------------------------------------
CSV results saved to canbench_results.csv

@github-actions
Copy link
Copy Markdown

canbench 🏋 (dir: ./benchmarks/btreeset) d64bc23 2025-07-14 10:05:55 UTC

./benchmarks/btreeset/canbench_results.yml is up to date
📦 canbench_results_btreeset.csv available in artifacts

---------------------------------------------------

Summary:
  instructions:
    status:   No significant changes 👍
    counts:   [total 100 | regressed 0 | improved 0 | new 0 | unchanged 100]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

  heap_increase:
    status:   No significant changes 👍
    counts:   [total 100 | regressed 0 | improved 0 | new 0 | unchanged 100]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

  stable_memory_increase:
    status:   No significant changes 👍
    counts:   [total 100 | regressed 0 | improved 0 | new 0 | unchanged 100]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

---------------------------------------------------
CSV results saved to canbench_results.csv

@github-actions
Copy link
Copy Markdown

canbench 🏋 (dir: ./benchmarks/io_chunks) d64bc23 2025-07-14 10:06:30 UTC

./benchmarks/io_chunks/canbench_results.yml is up to date
📦 canbench_results_io_chunks.csv available in artifacts

---------------------------------------------------

Summary:
  instructions:
    status:   No significant changes 👍
    counts:   [total 18 | regressed 0 | improved 0 | new 0 | unchanged 18]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

  heap_increase:
    status:   No significant changes 👍
    counts:   [total 18 | regressed 0 | improved 0 | new 0 | unchanged 18]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

  stable_memory_increase:
    status:   No significant changes 👍
    counts:   [total 18 | regressed 0 | improved 0 | new 0 | unchanged 18]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

---------------------------------------------------
CSV results saved to canbench_results.csv

Copy link
Copy Markdown
Contributor

@berestovskyy berestovskyy left a comment

Choose a reason for hiding this comment

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

Looks good, thanks! Would be nice to also have a Jira reference.

@maksymar maksymar merged commit 5305320 into main Jul 14, 2025
18 of 20 checks passed
@maksymar maksymar deleted the maksym/nns branch July 14, 2025 10:24
maksymar added a commit that referenced this pull request Jul 14, 2025
This PR re-enables `nns` benchmark in the CI.

This is a follow-up PR after
#371.
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