Skip to content

Comments

perf: optimize sourcemap ignore list with fast path for static string | RegExp #6313

Merged
graphite-app[bot] merged 1 commit intomainfrom
09-23-perf_reduce_sourcemap_ignore_list_js_function_call
Sep 23, 2025
Merged

perf: optimize sourcemap ignore list with fast path for static string | RegExp #6313
graphite-app[bot] merged 1 commit intomainfrom
09-23-perf_reduce_sourcemap_ignore_list_js_function_call

Conversation

@IWANABETHATGUY
Copy link
Member

@IWANABETHATGUY IWANABETHATGUY commented Sep 23, 2025

Linux

OS: Linux 6.9 Pop!_OS 22.04 LTS
CPU: (32) x64 AMD Ryzen 9 5950X 16-Core Processor
Memory: 37.53 GB / 62.67 GB

image

Adding a static string | RegExp value for options output.sourcemapIgnoreList which reduces a lot of unnecessary rust -> js function call, so that performance got improved when sourcemap is enabled.

Copy link
Member Author


How to use the Graphite Merge Queue

Add the label graphite: merge to this PR to add it to 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.

@IWANABETHATGUY IWANABETHATGUY marked this pull request as ready for review September 23, 2025 07:44
@netlify
Copy link

netlify bot commented Sep 23, 2025

Deploy Preview for rolldown-rs ready!

Name Link
🔨 Latest commit a877358
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/68d26f515c6f6f000844e4bc
😎 Deploy Preview https://deploy-preview-6313--rolldown-rs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 23, 2025

Benchmarks Rust

  • target: main(e593ff6)
  • pr: 09-23-perf_reduce_sourcemap_ignore_list_js_function_call(a877358)
group                                                        pr                                     target
-----                                                        --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol              1.01     76.0±1.20ms        ? ?/sec    1.00     75.2±1.27ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap    1.01     85.0±1.25ms        ? ?/sec    1.00     84.3±1.32ms        ? ?/sec
bundle/bundle@rome_ts                                        1.01    116.8±1.67ms        ? ?/sec    1.00    116.2±2.62ms        ? ?/sec
bundle/bundle@rome_ts-sourcemap                              1.01    137.6±3.56ms        ? ?/sec    1.00    136.8±1.58ms        ? ?/sec
bundle/bundle@threejs                                        1.01     44.4±1.57ms        ? ?/sec    1.00     43.9±0.88ms        ? ?/sec
bundle/bundle@threejs-sourcemap                              1.01     53.5±0.87ms        ? ?/sec    1.00     53.1±0.83ms        ? ?/sec
bundle/bundle@threejs10x                                     1.00    455.9±3.93ms        ? ?/sec    1.00    456.0±5.94ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                           1.00    535.3±5.95ms        ? ?/sec    1.00    533.8±5.52ms        ? ?/sec
scan/scan@rome_ts                                            1.00     92.1±1.68ms        ? ?/sec    1.00     92.5±2.18ms        ? ?/sec
scan/scan@threejs                                            1.00     32.9±0.37ms        ? ?/sec    1.00     33.0±0.44ms        ? ?/sec
scan/scan@threejs10x                                         1.00    344.2±5.18ms        ? ?/sec    1.00    345.6±4.69ms        ? ?/sec

@IWANABETHATGUY IWANABETHATGUY marked this pull request as draft September 23, 2025 08:29
@IWANABETHATGUY IWANABETHATGUY force-pushed the 09-23-perf_reduce_sourcemap_ignore_list_js_function_call branch from 9eaf66d to ac82e85 Compare September 23, 2025 09:17
@IWANABETHATGUY IWANABETHATGUY marked this pull request as ready for review September 23, 2025 09:58
@graphite-app
Copy link
Contributor

graphite-app bot commented Sep 23, 2025

Merge activity

## Linux
>    OS: Linux 6.9 Pop!_OS 22.04 LTS
>    CPU: (32) x64 AMD Ryzen 9 5950X 16-Core Processor
>    Memory: 37.53 GB / 62.67 GB

<img width="1779" height="353" alt="image" src="https://github.com/user-attachments/assets/8bd46cb6-1bd5-485a-9d6b-a1c543cada07" />
@graphite-app graphite-app bot force-pushed the 09-23-perf_reduce_sourcemap_ignore_list_js_function_call branch from ac82e85 to a877358 Compare September 23, 2025 09:58
@IWANABETHATGUY IWANABETHATGUY changed the title perf: reduce sourcemap_ignore_list js function call perf: optimize sourcemap ignore list with fast path for static string | RegExp Sep 23, 2025
@graphite-app graphite-app bot merged commit a877358 into main Sep 23, 2025
30 checks passed
@graphite-app graphite-app bot deleted the 09-23-perf_reduce_sourcemap_ignore_list_js_function_call branch September 23, 2025 10:08
shulaoda pushed a commit that referenced this pull request Sep 24, 2025
## [1.0.0-beta.40] - 2025-09-24

⚡ Sourcemap Performance Boost
- 20%-30% faster sourcemap generation
- Consistent gains across all platforms

### 🚀 Features

- rolldown: oxc v0.92.0 (#6322) by @Boshen
- adding partial `MagicString` binding (#6289) by @IWANABETHATGUY
- rolldown_plugin_vite_html: initialize (#6292) by @shulaoda

### 🐛 Bug Fixes

- rolldown_plugin_react_refresh_wrapper: avoid using cwd to allow using as a callable plugin (#6318) by @sapphi-red
- rolldown_plugin_transform: resolve tsconfig from absolute path (#6311) by @shulaoda

### 🚜 Refactor

- Construct MagicString with `Cow<str>` instead of `&str` (#6288) by @IWANABETHATGUY
- throw error if generating oxc runtime helper fails (#6291) by @shulaoda

### 📚 Documentation

- add more description about sourcemapIgnoreList (#6314) by @IWANABETHATGUY

### ⚡ Performance

- reduce `sourcemap_ignore_list` js function call (#6313) by @IWANABETHATGUY
- string_wizard: use memchr to find patterns in `replace` (#6312) by @IWANABETHATGUY
- simplify sourcemap token processing in collapse_sourcemaps (#6310) by @IWANABETHATGUY
- rolldown: some minor perf optimization (#6306) by @Brooooooklyn
- rolldown: fine-tuning the tokio scheduler (#6272) by @Brooooooklyn

### ⚙️ Miscellaneous Tasks

- deps: lock file maintenance rust crates (#6302) by @renovate[bot]
- deps: lock file maintenance npm packages (#6301) by @renovate[bot]
- use `lto: thin` in profile mode for better profiling experience. (#6320) by @IWANABETHATGUY
- adjust the tokio runtime config in bench (#6305) by @Brooooooklyn
- deps: update dependency rolldown-plugin-dts to v0.16.8 (#6307) by @renovate[bot]
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.

2 participants