Skip to content

Conversation

kdy1
Copy link
Contributor

@kdy1 kdy1 commented May 21, 2025

The size of Range is now 24 bytes instead of 44 bytes. RawToken is 28 bytes, but dereferencing it is a trivial memory move rather than an allocation.

I'll report the numbers within this week.

@kdy1 kdy1 marked this pull request as ready for review May 21, 2025 21:09
Copy link
Contributor

@loewenheim loewenheim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just some nits.

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();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we could skip this clone in case the tokens are already sorted? Might be another optimization potentially.

kdy1 and others added 2 commits May 22, 2025 05:38
Co-authored-by: Sebastian Zivota <[email protected]>
Co-authored-by: Sebastian Zivota <[email protected]>
@Swatinem Swatinem merged commit 24a07e3 into getsentry:master May 22, 2025
6 checks passed
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
@kdy1 kdy1 deleted the kdy1/adjust-copy branch June 5, 2025 22:35
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.

3 participants