feat!: Use mutable structs for std collections and make internals private#1796
Open
mark-koch wants to merge 8 commits into
Open
feat!: Use mutable structs for std collections and make internals private#1796mark-koch wants to merge 8 commits into
mark-koch wants to merge 8 commits into
Conversation
mark-koch
commented
Jun 2, 2026
Comment on lines
-38
to
+40
| def __len__(self: PriorityQueue[T, MAX_SIZE]) -> int: | ||
| def __len__(self) -> int: |
Collaborator
Author
There was a problem hiding this comment.
driveby: I used some more modern guppy features to make these signatures more compact
Contributor
|
| Branch | mk/mutable-collections |
| Testbed | Linux |
Click to view all benchmark results
| Benchmark | hugr_bytes | Benchmark Result bytes x 1e3 (Result Δ%) | Upper Boundary bytes x 1e3 (Limit %) | hugr_nodes | Benchmark Result nodes (Result Δ%) | Upper Boundary nodes (Limit %) |
|---|---|---|---|---|---|---|
| tests/benchmarks/test_big_array.py::test_big_array_compile | 📈 view plot 🚷 view threshold | 158.77 x 1e3(0.00%)Baseline: 158.77 x 1e3 | 160.36 x 1e3 (99.01%) | 📈 view plot 🚷 view threshold | 6,641.00(0.00%)Baseline: 6,641.00 | 6,707.41 (99.01%) |
| tests/benchmarks/test_ctrl_flow.py::test_many_ctrl_flow_compile | 📈 view plot 🚷 view threshold | 27.54 x 1e3(0.00%)Baseline: 27.54 x 1e3 | 27.81 x 1e3 (99.01%) | 📈 view plot 🚷 view threshold | 1,074.00(0.00%)Baseline: 1,074.00 | 1,084.74 (99.01%) |
| tests/benchmarks/test_queue_push_pop.py::test_queue_push_benchmark_compile | 📈 view plot 🚷 view threshold | 10.94 x 1e3(+0.32%)Baseline: 10.91 x 1e3 | 11.02 x 1e3 (99.33%) | 📈 view plot 🚷 view threshold | 309.00(+0.32%)Baseline: 308.00 | 311.08 (99.33%) |
| tests/benchmarks/test_queue_push_pop.py::test_queue_push_pop_benchmark_compile | 📈 view plot 🚷 view threshold | 14.83 x 1e3(-0.04%)Baseline: 14.84 x 1e3 | 14.99 x 1e3 (98.97%) | 📈 view plot 🚷 view threshold | 432.00(-0.69%)Baseline: 435.00 | 439.35 (98.33%) |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## mk/mutable-structs #1796 +/- ##
======================================================
- Coverage 93.02% 93.00% -0.03%
======================================================
Files 135 135
Lines 13138 13145 +7
======================================================
+ Hits 12222 12225 +3
- Misses 916 920 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Merging this PR will improve performance by 15.45%
Performance Changes
Tip Curious why this is faster? Comment Comparing |
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.
Closes #1774
BREAKING CHANGE: Interface of
guppylang.std.collections.{Stack, Queue, PriorityQueue}now borrows the queue instead of taking and returning itBREAKING CHANGE: All fields of
guppylang.std.collections.{Stack, Queue, PriorityQueue}are now privateDepends on #1793