Skip to content

feat: Allow repeated scopes#94

Merged
dsarlis merged 4 commits intomainfrom
dimitris/allow-repeated-scopes
May 2, 2025
Merged

feat: Allow repeated scopes#94
dsarlis merged 4 commits intomainfrom
dimitris/allow-repeated-scopes

Conversation

@dsarlis
Copy link
Copy Markdown
Contributor

@dsarlis dsarlis commented May 2, 2025

This change allows for repeated scopes to be used in canbench benchmarks. Previously the code would straight up refuse to have a similarly named scope -- I think this is a mistake, there are very valid scenarios (example case from stable structures) where someone might have a loop and they want to declare a scope inside it to measure some operation.

People should already be careful not declaring the same names for unrelated scopes, so I don't think a protection against it is worth it (that's I guess the main reason for this restriction currently) and the extra benefit you get to measure things inside loops (which can usually be where heavier parts of processing happens) outweighs some risk that someone re-uses the same name of scope.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 2, 2025

canbench 🏋 (dir: examples/btreemap_vs_hashmap)

No significant performance changes detected ✅

examples/btreemap_vs_hashmap/canbench_results.yml is up to date ✅


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

Benchmark: insert_users
  total:
    instructions: 2.56 B (no change)
    heap_increase: 872 pages (no change)
    stable_memory_increase: 0 pages (no change)

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

Benchmark: remove_users
  total:
    instructions: 2.11 B (no change)
    heap_increase: 0 pages (no change)
    stable_memory_increase: 0 pages (no change)

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

Benchmark: pre_upgrade_bench
  total:
    instructions: 438.88 M (0.00%) (change within noise threshold)
    heap_increase: 519 pages (no change)
    stable_memory_increase: 184 pages (no change)

  serialize_state (scope):
    instructions: 423.95 M (no change)
    heap_increase: 519 pages (no change)
    stable_memory_increase: 0 pages (no change)

  writing_to_stable_memory (scope):
    instructions: 14.93 M (no change)
    heap_increase: 0 pages (no change)
    stable_memory_increase: 184 pages (no change)

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

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 2, 2025

canbench 🏋 (dir: examples/fibonacci)

No significant performance changes detected ✅

examples/fibonacci/canbench_results.yml is up to date ✅


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

Benchmark: fibonacci_20
  total:
    instructions: 726 (-0.55%) (change within noise threshold)
    heap_increase: 0 pages (no change)
    stable_memory_increase: 0 pages (no change)

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

Benchmark: fibonacci_8a
  total:
    instructions: 450 (-0.88%) (change within noise threshold)
    heap_increase: 0 pages (no change)
    stable_memory_increase: 0 pages (no change)

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

Benchmark: fibonacci_8b
  total:
    instructions: 207 (no change)
    heap_increase: 0 pages (no change)
    stable_memory_increase: 0 pages (no change)

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

Benchmark: fibonacci_8c
  total:
    instructions: 391 (-1.01%) (change within noise threshold)
    heap_increase: 0 pages (no change)
    stable_memory_increase: 0 pages (no change)

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

Benchmark: fibonacci_45
  total:
    instructions: 1301 (-0.31%) (change within noise threshold)
    heap_increase: 0 pages (no change)
    stable_memory_increase: 0 pages (no change)

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

@dsarlis dsarlis marked this pull request as ready for review May 2, 2025 11:25
@dsarlis dsarlis requested a review from a team as a code owner May 2, 2025 11:25
@dsarlis dsarlis enabled auto-merge (squash) May 2, 2025 12:10
@dsarlis dsarlis merged commit 8ee59be into main May 2, 2025
13 checks passed
@dsarlis dsarlis deleted the dimitris/allow-repeated-scopes branch May 2, 2025 12:21
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