perf: Make adjust_mappings faster by reducing the type size#124
Merged
Swatinem merged 3 commits intogetsentry:masterfrom May 22, 2025
Merged
perf: Make adjust_mappings faster by reducing the type size#124Swatinem merged 3 commits intogetsentry:masterfrom
adjust_mappings faster by reducing the type size#124Swatinem merged 3 commits intogetsentry:masterfrom
Conversation
loewenheim
approved these changes
May 22, 2025
Contributor
loewenheim
left a comment
There was a problem hiding this comment.
Looks good, just some nits.
Swatinem
approved these changes
May 22, 2025
| create_ranges(adjustment.tokens.clone(), |t| (t.src_line, t.src_col)); | ||
| let mut self_tokens = std::mem::take(&mut self.tokens); | ||
| let original_ranges = create_ranges(&mut self_tokens, |t| (t.dst_line, t.dst_col)); | ||
| let mut adjustment_tokens = adjustment.tokens.clone(); |
Contributor
There was a problem hiding this comment.
I wonder if we could skip this clone in case the tokens are already sorted? Might be another optimization potentially.
Co-authored-by: Sebastian Zivota <loewenheim@users.noreply.github.com>
Co-authored-by: Sebastian Zivota <loewenheim@users.noreply.github.com>
This was referenced May 22, 2025
kdy1
added a commit
to vercel/next.js
that referenced
this pull request
May 22, 2025
### What? Use the latest version of the `sourcemap` crate ### Why? In the name of the performance! Applies - getsentry/rust-sourcemap#122 - getsentry/rust-sourcemap#124
eps1lon
pushed a commit
to vercel/next.js
that referenced
this pull request
May 23, 2025
### What? Use the latest version of the `sourcemap` crate ### Why? In the name of the performance! Applies - getsentry/rust-sourcemap#122 - getsentry/rust-sourcemap#124
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.
The size of
Rangeis now 24 bytes instead of 44 bytes.RawTokenis 28 bytes, but dereferencing it is a trivial memory move rather than an allocation.I'll report the numbers within this week.