perf(transformer/using): avoid large types on stack#9676
Merged
graphite-app[bot] merged 1 commit intomainfrom Mar 11, 2025
Merged
Conversation
This was referenced Mar 11, 2025
Member
Author
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. |
This was referenced Mar 11, 2025
CodSpeed Performance ReportMerging #9676 will create unknown performance changesComparing Summary
Benchmarks breakdown
|
camc314
approved these changes
Mar 11, 2025
Contributor
camc314
left a comment
There was a problem hiding this comment.
thanks for the detail in the description!
c1c03c8 to
a4fed5a
Compare
8d255b1 to
2043688
Compare
Contributor
Merge activity
|
a4fed5a to
786b7dc
Compare
graphite-app bot
pushed a commit
that referenced
this pull request
Mar 11, 2025
Follow-on after #9310. Holding large types on the stack is generally best to avoid where possible. Get the data into the arena as quickly as possible, and then only need to pass around `Box`es (which are only 8 bytes). In the case of `Class`, previously we were `unbox`-ing a `Class` (pull it out of the arena, and onto the stack) and then allocating it back into the arena again. `Class` is a large type - 160 bytes - and this extra work doesn't add any value. We can just leave the `Class` where it is in the arena, and pass around a `Box<Class>`. This is something of a micro-optimization, but they all add up...
2043688 to
d06e5f2
Compare
786b7dc to
21859ca
Compare
graphite-app bot
pushed a commit
that referenced
this pull request
Mar 11, 2025
Follow-on after #9310. Holding large types on the stack is generally best to avoid where possible. Get the data into the arena as quickly as possible, and then only need to pass around `Box`es (which are only 8 bytes). In the case of `Class`, previously we were `unbox`-ing a `Class` (pull it out of the arena, and onto the stack) and then allocating it back into the arena again. `Class` is a large type - 160 bytes - and this extra work doesn't add any value. We can just leave the `Class` where it is in the arena, and pass around a `Box<Class>`. This is something of a micro-optimization, but they all add up...
d06e5f2 to
36aa13d
Compare
Follow-on after #9310. Holding large types on the stack is generally best to avoid where possible. Get the data into the arena as quickly as possible, and then only need to pass around `Box`es (which are only 8 bytes). In the case of `Class`, previously we were `unbox`-ing a `Class` (pull it out of the arena, and onto the stack) and then allocating it back into the arena again. `Class` is a large type - 160 bytes - and this extra work doesn't add any value. We can just leave the `Class` where it is in the arena, and pass around a `Box<Class>`. This is something of a micro-optimization, but they all add up...
21859ca to
076d872
Compare
36aa13d to
15dd0d4
Compare
Base automatically changed from
03-11-refactor_transformer_using_remove_.into_
to
main
March 11, 2025 12:20
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.

Follow-on after #9310.
Holding large types on the stack is generally best to avoid where possible. Get the data into the arena as quickly as possible, and then only need to pass around
Boxes (which are only 8 bytes).In the case of
Class, previously we wereunbox-ing aClass(pull it out of the arena, and onto the stack) and then allocating it back into the arena again.Classis a large type - 160 bytes - and this extra work doesn't add any value. We can just leave theClasswhere it is in the arena, and pass around aBox<Class>.This is something of a micro-optimization, but they all add up...