Skip to content

perf: batch sourcemapPathTransform calls - #10763

Merged
IWANABETHATGUY merged 1 commit into
perf/batch-sourcemap-ignore-listfrom
perf/batch-sourcemap-path-transform
Sep 20, 2026
Merged

IWANABETHATGUY merged 1 commit into
perf/batch-sourcemap-ignore-listfrom
perf/batch-sourcemap-path-transform

Conversation

@IWANABETHATGUY

Copy link
Copy Markdown
Member

sourcemapPathTransform ran once per source of a sourcemap. try_join_all overlapped the calls, but a chunk with N sources still paid N napi crossings.

The JS side now takes the whole source list in one shim and loops in JS. A path cannot be reduced to a byte, so the batch is still an array of strings, and the shim checks each result so a wrong type names its source.

refs #10762

@IWANABETHATGUY
IWANABETHATGUY force-pushed the perf/batch-sourcemap-path-transform branch from 7cf43a4 to 0fb7764 Compare September 10, 2026 03:40
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://perf-batch-sourcemap-path-transform-rolldown-rs.voidzero-docs.workers.dev (commit a56faee)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://9160c981-rolldown-rs.voidzero-docs.workers.dev a56faee 2026-09-20T11:38:28.661Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://76484af1-rolldown-rs.voidzero-docs.workers.dev 0fb7764 2026-09-10T03:43:51.172Z Visit the dashboard ↗

@netlify

netlify Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for rolldown-rs ready!

Name Link
🔨 Latest commit a56faee
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/6aafc543afc4080008b4cd7d
😎 Deploy Preview https://deploy-preview-10763--rolldown-rs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

`sourcemapPathTransform` ran once per source of a sourcemap, and each call
crossed the napi boundary on its own. `try_join_all` overlapped the calls, but a
chunk with N sources still paid N crossings.

The JS side now hands the binding one shim that takes the whole source list and
loops in JS, so a sourcemap crosses once. The shim checks each result, so a
wrong type still names its source.
@IWANABETHATGUY
IWANABETHATGUY force-pushed the perf/batch-sourcemap-path-transform branch from 0fb7764 to a56faee Compare September 20, 2026 11:36
@IWANABETHATGUY
IWANABETHATGUY marked this pull request as ready for review September 20, 2026 11:39
@codspeed

codspeed Bot commented Sep 20, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 7 untouched benchmarks
⏩ 10 skipped benchmarks1


Comparing perf/batch-sourcemap-path-transform (a56faee) with main (cd911a4)2

Open in CodSpeed

Footnotes

  1. 10 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

  2. No successful run was found on perf/batch-sourcemap-ignore-list (578df0d) during the generation of this report, so main (cd911a4) was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@IWANABETHATGUY
IWANABETHATGUY merged commit 7b9340b into main Sep 20, 2026
56 of 67 checks passed
@IWANABETHATGUY
IWANABETHATGUY deleted the perf/batch-sourcemap-path-transform branch September 20, 2026 14:32
Brooooooklyn added a commit that referenced this pull request Sep 20, 2026
Brings in three commits from main:

- 2d5b292 perf: batch `sourcemapIgnoreList` calls (#10762) - the binding
  now hands the whole source list to one JS call and reads back a
  Uint8Array of flags, instead of one napi call per source.
- 7b9340b perf: batch `sourcemapPathTransform` calls (#10763) - same
  shape, with an array of strings coming back.
- c8172bd chore(deps): update dependency rolldown-plugin-dts to v0.28.6
  (#10924) - lockfile only.

One conflict, in packages/rolldown/src/utils/bindingify-output-options.ts.
Main wrapped both sourcemap callbacks in new batch shims; this branch had
wrapped them in wrapOptionalBuildCallback so every user callback runs
inside the build scope. Both are kept, nested the way the codeSplitting
group callbacks in the same file already nest them: the measure wrapper
innermost, the batch shim around it, and wrapOptionalBuildCallback
outermost, so one build-scope entry covers the whole batch loop rather
than one per source. The two new batch helpers from main and this
branch's exported wrapOptionalBuildCallback both survive at the end of
the file.

The generated binding type files were regenerated, not hand-merged. That
also updated rolldown-binding.wasip1.d.cts, which main did not touch but
which carries the same BindingOutputOptions shape.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01T34fMrYCf2V13Mg8BKmnda
@rolldown-guard rolldown-guard Bot mentioned this pull request Sep 23, 2026
shulaoda added a commit that referenced this pull request Sep 23, 2026
## [1.2.10] - 2026-09-23

### 🚀 Features

- rolldown_plugin_esm_external_require: prefer 'module.exports' over a namespace spread (#10901) by @isker
- watch: support directories in addWatchFile (#10944) by @shulaoda
- label code-splitting timing rows (#10896) by @IWANABETHATGUY
- separate code-splitting group timing rows (#10892) by @IWANABETHATGUY
- clarify callback owners in the timing report (#10890) by @IWANABETHATGUY
- add checks.bundlerTimings with deprecated pluginTimings alias (#10883) by @IWANABETHATGUY

### 🐛 Bug Fixes

- code-splitting: initialize leaves behind a re-exported namespace import (#10694) by @hyfdev
- node: record the WASI target on the WebContainer binding fallback (#10952) by @shulaoda
- dev: force incremental build on in DevEngine::new (#10958) by @o-alexandrov
- tree-shaking: propagate side effects through cycles (#10893) by @IWANABETHATGUY
- deconflict CJS locals that shadow a renamed require wrapper (#10793) by @logaretm
- include group indexes in labeled `codeSplitting` timing rows (#10916) by @IWANABETHATGUY
- docs: type-check Algolia `indices` option (#10934) by @shulaoda
- docs: restore Algolia search (#10929) by @isker
- tell code-splitting timing rows apart by position (#10903) by @IWANABETHATGUY

### 🚜 Refactor

- rolldown_fs_watcher: remove the single-path API (#10950) by @shulaoda
- dev: register watch files through FsWatcher (#10949) by @shulaoda
- watch: let FsWatcher own the watched paths (#10948) by @shulaoda
- watch: identify watch files by normalized absolute path (#10943) by @shulaoda
- plugin: build a plugin-resolved `ResolvedId` in one place (#10921) by @IWANABETHATGUY

### 📚 Documentation

- dev: add HMR design, align dev docs and engine comments (#10271) by @h-a-n-a

### ⚡ Performance

- batch `sourcemapPathTransform` calls (#10763) by @IWANABETHATGUY
- batch `sourcemapIgnoreList` calls (#10762) by @IWANABETHATGUY
- hmr: drop the unused kind argument from registerFactory (#10915) by @h-a-n-a

### 🧪 Testing

- handle Windows paths in sourcemap callback tests (#10942) by @IWANABETHATGUY

### ⚙️ Miscellaneous Tasks

- replace custom `ban-expect-assertions` JS lint with builtin `no-restricted-properties` (#10933) by @isker
- deps: update napi (#10959) by @renovate[bot]
- deps: upgrade oxc to 0.151.0 (#10939) by @camc314
- deps: update test262 submodule for tests (#10941) by @rolldown-guard[bot]
- deps: update npm packages (#10931) by @renovate[bot]
- deps: update napi (#10928) by @renovate[bot]
- deps: update dependency vite-plus to v0.3.3 (#10914) by @renovate[bot]
- deps: update rust crates (#10932) by @renovate[bot]
- deps: update github actions (#10930) by @renovate[bot]
- deps: update dependency rolldown-plugin-dts to v0.28.6 (#10924) by @renovate[bot]
- deps: update crate-ci/typos action to v1.50.2 (#10917) by @renovate[bot]
- deps: update dependency @napi-rs/cli to v3.10.4 (#10913) by @renovate[bot]
- deps: update napi (#10897) by @renovate[bot]

### ❤️ New Contributors

* @o-alexandrov made their first contribution in [#10958](#10958)

Co-authored-by: shulaoda <[email protected]>
felixonmars added a commit to felixonmars/archriscv-packages that referenced this pull request Oct 28, 2026
Build the locked Rolldown 1.2.13 binding instead of 1.2.1 and update its
source checksums. The newer JavaScript batches sourcemapPathTransform
results into an array, which the old native binding rejects with
"The function returned `object`, but expected `string`."

https://archriscv.felixc.at/.status/logs/stalwart-webadmin/stalwart-webadmin-2.0.0-1.log
https://github.com/stalwartlabs/webui/blob/v2.0.0/package-lock.json
rolldown/rolldown#10763
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