Skip to content

perf(dev): only ship rows with dynamic edges in registerGraph - #11019

Merged
graphite-app[bot] merged 1 commit into
mainfrom
dev-sparse-dynamic-edges
Sep 29, 2026
Merged

graphite-app[bot] merged 1 commit into
mainfrom
dev-sparse-dynamic-edges

Conversation

@h-a-n-a

@h-a-n-a h-a-n-a commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

use a sparse map to store dynamic edges in registerGraph.

This will NOT break Vite runtime.

Benchmark

Data: 42 lazy chunks from a large real-world app, with 23,834 module rows. The app does not call acceptExports, so dynamicEdges is the only field that changes.

Totals

                     before        after       saved
registerGraph     4,299,916    4,230,205      69,711   (−1.6% of payload)
all chunk bytes 282,446,695  282,376,984      69,711   (−0.025%)

Largest chunks

chunk rows before after saved
chunk A 7,458 1,289,047 1,267,016 22,031 (1.7%)
chunk B 4,177 727,719 715,784 11,935 (1.6%)
chunk C 3,724 712,066 701,097 10,969 (1.5%)
chunk D 2,715 474,344 466,252 8,092 (1.7%)
chunk E 2,603 564,362 556,845 7,517 (1.3%)
chunk F 1,567 196,125 191,437 4,688 (2.4%)

The saving is about 3 bytes for each module that has no import().

Small payloads: 22 of the 42 payloads have 5 rows or fewer, and together they save 10 bytes. A one-row payload whose row has a dynamic edge grows by 2 bytes:

before: ...localCount:1,edges:[[]],dynamicEdges:[[1]]});
after:  ...localCount:1,edges:[[]],dynamicEdges:{0:[1]}});

h-a-n-a commented Sep 28, 2026

Copy link
Copy Markdown
Member Author

How to use the Graphite Merge Queue

Add the label graphite: merge-when-ready 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.

@netlify

netlify Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit 3f76b5c
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/6abb2a4b9ef7cb0008574122

@cloudflare-workers-and-pages

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

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://dev-sparse-dynamic-edges-rolldown-rs.voidzero-docs.workers.dev (commit 3f76b5c)

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://b57a282f-rolldown-rs.voidzero-docs.workers.dev 3f76b5c 2026-09-29T03:05:24.771Z Visit the dashboard ↗
  • Build: In progress 🔵

View logs ↗
f62c661 2026-09-29T03:01:39.866Z View logs ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://40f66f8a-rolldown-rs.voidzero-docs.workers.dev bb9aca1 2026-09-28T15:02:13.324Z Visit the dashboard ↗

h-a-n-a commented Sep 29, 2026 •

Copy link
Copy Markdown
Member Author

Merge activity

  • Sep 29, 2:55 AM UTC: The merge label 'graphite: merge-when-ready' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Sep 29, 3:00 AM UTC: h-a-n-a added this pull request to the Graphite merge queue.
  • Sep 29, 3:07 AM UTC: Merged by the Graphite merge queue.

graphite-app Bot pushed a commit that referenced this pull request Sep 29, 2026
use a sparse map to store dynamic edges in `registerGraph`.

This will NOT break Vite runtime.

## Benchmark

**Data:** 42 lazy chunks from a large real-world app, with 23,834 module rows. The app does not call `acceptExports`, so `dynamicEdges` is the only field that changes.

**Totals**

```
                     before        after       saved
registerGraph     4,299,916    4,230,205      69,711   (−1.6% of payload)
all chunk bytes 282,446,695  282,376,984      69,711   (−0.025%)
```

**Largest chunks**

| chunk | rows | before | after | saved |
|---|---|---|---|---|
| chunk A | 7,458 | 1,289,047 | 1,267,016 | 22,031 (1.7%) |
| chunk B | 4,177 | 727,719 | 715,784 | 11,935 (1.6%) |
| chunk C | 3,724 | 712,066 | 701,097 | 10,969 (1.5%) |
| chunk D | 2,715 | 474,344 | 466,252 | 8,092 (1.7%) |
| chunk E | 2,603 | 564,362 | 556,845 | 7,517 (1.3%) |
| chunk F | 1,567 | 196,125 | 191,437 | 4,688 (2.4%) |

The saving is about 3 bytes for each module that has no `import()`.

**Small payloads:** 22 of the 42 payloads have 5 rows or fewer, and together they save 10 bytes. A one-row payload whose row has a dynamic edge grows by 2 bytes:

```
before: ...localCount:1,edges:[[]],dynamicEdges:[[1]]});
after:  ...localCount:1,edges:[[]],dynamicEdges:{0:[1]}});
```
@graphite-app
graphite-app Bot force-pushed the dev-sparse-dynamic-edges branch from bb9aca1 to f62c661 Compare September 29, 2026 03:01
use a sparse map to store dynamic edges in `registerGraph`.

This will NOT break Vite runtime.

## Benchmark

**Data:** 42 lazy chunks from a large real-world app, with 23,834 module rows. The app does not call `acceptExports`, so `dynamicEdges` is the only field that changes.

**Totals**

```
                     before        after       saved
registerGraph     4,299,916    4,230,205      69,711   (−1.6% of payload)
all chunk bytes 282,446,695  282,376,984      69,711   (−0.025%)
```

**Largest chunks**

| chunk | rows | before | after | saved |
|---|---|---|---|---|
| chunk A | 7,458 | 1,289,047 | 1,267,016 | 22,031 (1.7%) |
| chunk B | 4,177 | 727,719 | 715,784 | 11,935 (1.6%) |
| chunk C | 3,724 | 712,066 | 701,097 | 10,969 (1.5%) |
| chunk D | 2,715 | 474,344 | 466,252 | 8,092 (1.7%) |
| chunk E | 2,603 | 564,362 | 556,845 | 7,517 (1.3%) |
| chunk F | 1,567 | 196,125 | 191,437 | 4,688 (2.4%) |

The saving is about 3 bytes for each module that has no `import()`.

**Small payloads:** 22 of the 42 payloads have 5 rows or fewer, and together they save 10 bytes. A one-row payload whose row has a dynamic edge grows by 2 bytes:

```
before: ...localCount:1,edges:[[]],dynamicEdges:[[1]]});
after:  ...localCount:1,edges:[[]],dynamicEdges:{0:[1]}});
```
@graphite-app
graphite-app Bot force-pushed the dev-sparse-dynamic-edges branch from f62c661 to 3f76b5c Compare September 29, 2026 03:02
@graphite-app
graphite-app Bot merged commit 3f76b5c into main Sep 29, 2026
37 checks passed
@graphite-app
graphite-app Bot deleted the dev-sparse-dynamic-edges branch September 29, 2026 03:07
@rolldown-guard rolldown-guard Bot mentioned this pull request Sep 30, 2026
shulaoda added a commit that referenced this pull request Sep 30, 2026
## [1.2.12] - 2026-09-30

### 🚀 Features

- inline common chunks containing import() and deduplicate shared code in lazy chunks (#11034) by @hyfdev
- experimental `inlineCommonChunks` support (#10899) by @hyfdev
- dev: ship imported bindings for HMR partial accept (#10856) by @h-a-n-a

### 🐛 Bug Fixes

- chunking: re-derive chunk exec orders after the runtime leaves its host chunk (#11005) by @hyfdev
- code-splitting: gate member-read init paths on the reading statement (#11039) by @hyfdev
- code-splitting: retain initialization paths through re-exported namespaces (#11037) by @hyfdev
- dev: reject non-ESM output formats in dev mode (#11038) by @h-a-n-a
- dev: align `import.meta.hot.accept` deps with Vite (#10997) by @h-a-n-a
- dev: clear the resolver cache when a file is created or deleted (#10986) by @waltuov
- error: name the resolved specifier in unresolved import diagnostics (#11014) by @linyiru
- make entries-aware chunk merging deterministic (#11002) by @hyfdev
- watch: avoid restarting macOS watcher for unchanged paths (#10992) by @sep2

### 🚜 Refactor

- dev: ship the dev runtime entry as one file (#10998) by @h-a-n-a
- binding: remove `__internalForcePanic` (#10989) by @IWANABETHATGUY

### 📚 Documentation

- fix cloudflare preview builds (#10996) by @sapphi-red
- fix build config loader warning (#10994) by @sapphi-red
- deps: use Vite 8 (#10993) by @sapphi-red

### ⚡ Performance

- dev: only ship rows with dynamic edges in registerGraph (#11019) by @h-a-n-a

### 🧪 Testing

- code-splitting: cover more re-exported namespace shapes (#11042) by @hyfdev
- webcontainer: cover the WebContainer download fallback in plain Node (#10966) by @shulaoda
- dev: pin the runtime entry file layout that Vite serves (#10983) by @h-a-n-a

### ⚙️ Miscellaneous Tasks

- pin VOID_API_URL for the docs deploy (#11041) by @shulaoda
- opt into the WebContainer smoke test for napi bumps and loader changes (#10967) by @shulaoda
- deps: upgrade oxc to 0.152.0 (#11018) by @camc314
- deps: update rust crates (#11012) by @renovate[bot]
- deps: update npm packages (#11011) by @renovate[bot]
- deps: update crate-ci/typos action to v1.50.3 (#11023) by @renovate[bot]
- deps: update test262 submodule for tests (#11022) by @rolldown-guard[bot]
- deps: update rollup submodule for tests to v4.63.5 (#11021) by @rolldown-guard[bot]
- deps: update dependency vite-plus to v1 (#11017) by @renovate[bot]
- deps: update github actions (#11010) by @renovate[bot]
- remove `CLAUDE.md` (#10925) by @iiio2
- verify release debug info by matching file IDs (#10988) by @IWANABETHATGUY
- deps: update rollup submodule for tests to v4.63.4 (#10940) by @rolldown-guard[bot]

### ❤️ New Contributors

* @waltuov made their first contribution in [#10986](#10986)
* @linyiru made their first contribution in [#11014](#11014)
* @sep2 made their first contribution in [#10992](#10992)

Co-authored-by: shulaoda <[email protected]>
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