Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add oxc sourcemap crate #2825

Merged
merged 12 commits into from
Mar 28, 2024
Merged

Conversation

underfin
Copy link
Collaborator

The sourcemap implement port from rust-sourcemap, but has some different with it.

  • Encode sourcemap at parallel, including quote sourceContent and encode token to vlq mappings.
  • Avoid Sourcemap some methods overhead, like SourceMap::tokens() caused extra overhead at common cases. Here using SourceViewToken to instead of it.

@github-actions github-actions bot added the A-codegen Area - Code Generation label Mar 26, 2024
Copy link

codspeed-hq bot commented Mar 26, 2024

CodSpeed Performance Report

Merging #2825 will degrade performances by 3.84%

Comparing underfin:feat-add-oxc-sourcemap (cd22d32) with main (8c6936a)

Summary

⚡ 1 improvements
❌ 1 regressions
✅ 32 untouched benchmarks

🆕 2 new benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main underfin:feat-add-oxc-sourcemap Change
codegen_sourcemap[typescript.js] 1.4 s 1.3 s +3.96%
linter[cal.com.tsx] 2.4 s 2.5 s -3.84%
🆕 sourcemap[react.development.js] N/A 44.8 ms N/A
🆕 sourcemap[typescript.js] N/A 5.3 s N/A

Copy link
Member

@Boshen Boshen left a comment

Choose a reason for hiding this comment

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

This is really hard to review, can you comment in the places where we should take a look?

crates/oxc_sourcemap/src/decode.rs Outdated Show resolved Hide resolved
@underfin
Copy link
Collaborator Author

This is really hard to review, can you comment in the places where we should take a look?

Yeah. The code is larger to review, because the most code is port from rust-sourcemap. I only add some optimize to it. Maybe you can review ConcatSourcemapBuilder.rs or encode.rs at now, the changes of rust-sourcemap other files are small.

Copy link
Member

@Boshen Boshen left a comment

Choose a reason for hiding this comment

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

Need to run just fmt.

crates/oxc_sourcemap/src/encode.rs Show resolved Hide resolved
@Boshen Boshen merged commit b199cb8 into oxc-project:main Mar 28, 2024
30 of 31 checks passed
@Boshen Boshen mentioned this pull request Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area - Code Generation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants