Skip to content

Reuse inner allocation in collect_bicolor_runs#1578

Merged
jakelishman merged 1 commit intoQiskit:mainfrom
mtreinish:avoid-vec-alloc-bicolor
Apr 17, 2026
Merged

Reuse inner allocation in collect_bicolor_runs#1578
jakelishman merged 1 commit intoQiskit:mainfrom
mtreinish:avoid-vec-alloc-bicolor

Conversation

@mtreinish
Copy link
Copy Markdown
Member

This commit removes an unecessary iteration of every iteration of the loop inside collect_bicolor_runs(). The vec collection on every iteration of the loop results in a lot of allocations and frees for every node in the graph. We can reuse a single vec between each iteration and avoid this memory pressure.

This commit removes an unecessary iteration of every iteration of the
loop inside collect_bicolor_runs(). The vec collection on every
iteration of the loop results in a lot of allocations and frees for
every node in the graph. We can reuse a single vec between each
iteration and avoid this memory pressure.
@jakelishman jakelishman added this pull request to the merge queue Apr 17, 2026
Merged via the queue into Qiskit:main with commit fab7dff Apr 17, 2026
72 of 73 checks passed
gqf2008 pushed a commit to gqf2008/rustworkx that referenced this pull request Apr 26, 2026
This commit removes an unecessary iteration of every iteration of the
loop inside collect_bicolor_runs(). The vec collection on every
iteration of the loop results in a lot of allocations and frees for
every node in the graph. We can reuse a single vec between each
iteration and avoid this memory pressure.
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