perf(mangler): do not sort Vec if empty#13461
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Pull Request Overview
This PR implements a small performance optimization in the mangler by reordering an empty check before a sort operation to avoid unnecessary sorting of empty vectors.
- Moves the empty check for
tmp_bindingsbefore thesort_unstable()call - Prevents sorting when the vector is empty, saving computational cycles
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
CodSpeed Instrumentation Performance ReportMerging #13461 will not alter performanceComparing Summary
Footnotes
|
Merge activity
|
Tiny optimization to mangler. We sort a `Vec` and then check if it's empty. Move the empty check to be first, so can skip sorting in that case.
e24e10e to
caf40c5
Compare

Tiny optimization to mangler. We sort a
Vecand then check if it's empty. Move the empty check to be first, so can skip sorting in that case.