Skip to content

refactor: relocate vec types for benchmarks#336

Merged
maksymar merged 3 commits intomainfrom
maksym/bench-types
Jun 6, 2025
Merged

refactor: relocate vec types for benchmarks#336
maksymar merged 3 commits intomainfrom
maksym/bench-types

Conversation

@maksymar
Copy link
Copy Markdown
Contributor

@maksymar maksymar commented Jun 6, 2025

This PR refactors the benchmarks to remove the dependency on test types by introducing local copies of UnboundedVecN and BoundedVecN.

Copies of those types allow to run stable-structures version before those types were introduced. This change was tested on stable-structures v0.6.7.

@maksymar maksymar changed the title refactor: remove test types dependency on ic_stable_structures refactor: remove test types dependency on ic_stable_structures in benchmarks Jun 6, 2025
@maksymar maksymar changed the title refactor: remove test types dependency on ic_stable_structures in benchmarks refactor: remove test types dependency in benchmarks Jun 6, 2025
@maksymar maksymar requested a review from Copilot June 6, 2025 08:32
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 refactors the benchmarks to remove the dependency on test types by introducing local copies of UnboundedVecN and BoundedVecN. Key changes include:

  • Updating import statements to reference the new random and vec modules.
  • Adding a new module (benchmarks/src/vec.rs) that defines UnboundedVecN and BoundedVecN.
  • Adjusting benchmark files (compare and btreemap) to use the new type definitions.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
benchmarks/vec/src/main.rs Updated import for the Random trait.
benchmarks/src/vec.rs Added new file defining UnboundedVecN and BoundedVecN types.
benchmarks/src/random.rs Updated imports to use local vec types.
benchmarks/src/lib.rs Updated module declarations.
benchmarks/compare/src/main.rs Adjusted import of BoundedVecN to use new local definitions.
benchmarks/btreemap/src/main.rs Updated imports to reference local definitions and Random trait.

@maksymar maksymar changed the title refactor: remove test types dependency in benchmarks refactor: relocate vec types for benchmarks Jun 6, 2025
@maksymar maksymar marked this pull request as ready for review June 6, 2025 08:36
@maksymar maksymar requested a review from a team as a code owner June 6, 2025 08:36
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 6, 2025

canbench 🏋 (dir: ./benchmarks/btreemap) 434a572 2025-06-06 09:36:51 UTC

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

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

Summary:
  instructions:
    status:   No significant changes detected 👍
    counts:   [total 285 | regressed 0 | improved 0 | new 0 | unchanged 285]
    change:   [max +1.55M | p75 +4.03K | median +3.62K | p25 0 | min 0]
    change %: [max +0.03% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

  heap_increase:
    status:   No significant changes detected 👍
    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 detected 👍
    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

github-actions Bot commented Jun 6, 2025

canbench 🏋 (dir: ./benchmarks/vec) 434a572 2025-06-06 09:35:11 UTC

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

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

Summary:
  instructions:
    status:   No significant changes detected 👍
    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 detected 👍
    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 detected 👍
    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

github-actions Bot commented Jun 6, 2025

canbench 🏋 (dir: ./benchmarks/memory_manager) 434a572 2025-06-06 09:35:10 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 detected 👍
    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 detected 👍
    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 detected 👍
    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

github-actions Bot commented Jun 6, 2025

canbench 🏋 (dir: ./benchmarks/compare) 434a572 2025-06-06 09:36:32 UTC

./benchmarks/compare/canbench_results.yml is up to date
📦 canbench_results_compare.csv available in artifacts

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

Summary:
  instructions:
    status:   No significant changes detected 👍
    counts:   [total 18 | regressed 0 | improved 0 | new 0 | unchanged 18]
    change:   [max +65.00M | p75 +3.00M | median 0 | p25 0 | min 0]
    change %: [max +0.28% | p75 +0.07% | median 0.00% | p25 0.00% | min 0.00%]

  heap_increase:
    status:   No significant changes detected 👍
    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 detected 👍
    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

Comment thread benchmarks/src/vec.rs
@maksymar maksymar enabled auto-merge (squash) June 6, 2025 09:28
@maksymar maksymar merged commit be28605 into main Jun 6, 2025
14 checks passed
@maksymar maksymar deleted the maksym/bench-types branch June 6, 2025 09:38
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