Skip to content

perf(testing): share tokio runtime across fixture tests#8567

Merged
graphite-app[bot] merged 1 commit intomainfrom
perf/share-tokio-runtime-fixture-tests
Mar 7, 2026
Merged

perf(testing): share tokio runtime across fixture tests#8567
graphite-app[bot] merged 1 commit intomainfrom
perf/share-tokio-runtime-fixture-tests

Conversation

@Boshen
Copy link
Member

@Boshen Boshen commented Mar 6, 2026

Summary

Each of the ~1,682 fixture tests creates a new tokio::runtime::Runtime via Runtime::new().unwrap().block_on(...). This replaces that with a shared static runtime using OnceLock<Runtime>, eliminating repeated thread pool creation/teardown overhead.

Results (cargo test --workspace --exclude rolldown_binding)

Wall clock User CPU System CPU
Baseline (per-test runtime) 33.5s 133.5s 65.2s
Shared runtime 25.3s 116.1s 43.0s
Improvement -8.2s (24%) -17.4s -22.2s

The shared runtime saves ~8 seconds (24% faster) wall-clock time, with a notable reduction in system CPU time (65s → 43s) from eliminating repeated thread pool creation/teardown.

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings March 6, 2026 14:51
@netlify
Copy link

netlify bot commented Mar 6, 2026

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit 4732a16
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/69ab920aa4c9110008eb9958

Copy link
Member Author

Boshen commented Mar 6, 2026

Merge activity

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves test-suite performance in rolldown_testing by avoiding per-test Tokio runtime creation and instead reusing a single static runtime across all fixture integration tests.

Changes:

  • Introduces a shared static tokio::runtime::Runtime via OnceLock.
  • Updates fixture integration test runners to execute async work via the shared runtime.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

Benchmarks Rust

  • target: main(290a715)
  • pr: perf/share-tokio-runtime-fixture-tests(4732a16)
group                                                        pr                                     target
-----                                                        --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol              1.12     90.1±3.52ms        ? ?/sec    1.00     80.7±2.53ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap    1.14     97.8±2.63ms        ? ?/sec    1.00     85.5±1.58ms        ? ?/sec
bundle/bundle@rome_ts                                        1.12    183.1±3.72ms        ? ?/sec    1.00    162.9±7.43ms        ? ?/sec
bundle/bundle@rome_ts-sourcemap                              1.13    202.8±3.97ms        ? ?/sec    1.00    180.2±4.67ms        ? ?/sec
bundle/bundle@threejs                                        1.11     81.5±2.83ms        ? ?/sec    1.00     73.3±2.86ms        ? ?/sec
bundle/bundle@threejs-sourcemap                              1.13     89.3±2.38ms        ? ?/sec    1.00     79.1±1.96ms        ? ?/sec
bundle/bundle@threejs10x                                     1.03   779.2±17.49ms        ? ?/sec    1.00    759.9±7.01ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                           1.01    876.8±7.55ms        ? ?/sec    1.00    868.3±6.63ms        ? ?/sec
scan/scan@rome_ts                                            1.01     77.8±1.43ms        ? ?/sec    1.00     76.6±1.61ms        ? ?/sec
scan/scan@threejs                                            1.01     27.5±0.47ms        ? ?/sec    1.00     27.2±0.47ms        ? ?/sec
scan/scan@threejs10x                                         1.00    267.0±4.26ms        ? ?/sec    1.00    267.5±4.46ms        ? ?/sec

Copy link
Contributor

Copilot AI commented Mar 6, 2026

@hyf0 I've opened a new pull request, #8568, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI review requested due to automatic review settings March 7, 2026 01:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Copilot AI review requested due to automatic review settings March 7, 2026 01:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Copy link
Contributor

Copilot AI commented Mar 7, 2026

@hyf0 I've opened a new pull request, #8569, to work on those changes. Once the pull request is ready, I'll request review from you.

## Summary

Each of the ~1,682 fixture tests creates a new `tokio::runtime::Runtime` via `Runtime::new().unwrap().block_on(...)`. This replaces that with a shared static runtime using `OnceLock<Runtime>`, eliminating repeated thread pool creation/teardown overhead.

## Results (`cargo test --workspace --exclude rolldown_binding`)

| | Wall clock | User CPU | System CPU |
|---|---|---|---|
| **Baseline** (per-test runtime) | 33.5s | 133.5s | 65.2s |
| **Shared runtime** | 25.3s | 116.1s | 43.0s |
| **Improvement** | **-8.2s (24%)** | -17.4s | -22.2s |

The shared runtime saves ~8 seconds (24% faster) wall-clock time, with a notable reduction in system CPU time (65s → 43s) from eliminating repeated thread pool creation/teardown.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@graphite-app graphite-app bot force-pushed the perf/share-tokio-runtime-fixture-tests branch from 9d09474 to 4732a16 Compare March 7, 2026 02:48
@graphite-app graphite-app bot merged commit 4732a16 into main Mar 7, 2026
35 checks passed
@graphite-app graphite-app bot deleted the perf/share-tokio-runtime-fixture-tests branch March 7, 2026 02:58
@github-actions github-actions bot mentioned this pull request Mar 9, 2026
shulaoda added a commit that referenced this pull request Mar 9, 2026
## [1.0.0-rc.8] - 2026-03-09

### 🚀 Features

- watch: enable full functional fs watcher in wasm (#8575) by @hyf0
- watch: expose debounce related options (#8572) by @hyf0

### 🐛 Bug Fixes

- detect new URL(…, import.meta.url) with no-sub template literal (#8565) by @char
- devtools: trace dynamic imports in devtools (#8581) by @cal-gooo
- watch: rebuild when a previously missing file is created (#8562) by @hyf0-agent
- watch: filter out Access events to prevent infinite rebuild loop on Linux (#8557) by @hyf0-agent

### 🚜 Refactor

- watch: remove auto watch for fail imports (#8585) by @hyf0
- fs_watcher: unify the way of constructing watcher (#8571) by @hyf0
- cli: migrate CLI to CAC (#8551) by @h-a-n-a
- switch asset module support from hard-code to builtin plugin (#8546) by @hyf0

### 📚 Documentation

- fix subject-verb agreement in why-bundlers.md (#8591) by @brandonzylstra
- maintenance: align release and canary workflow guide (#8538) by @minsoo-web
- add `format` option to directives example config (#8590) by @shulaoda
- fix: change twitter to x logo in team (#8552) by @mdong1909
- correct composable filter support explanation (#8550) by @sapphi-red

### ⚡ Performance

- testing: share tokio runtime across fixture tests (#8567) by @Boshen

### 🧪 Testing

- hmr: fix infinite loop in dev server test retry logic (#8576) by @hyf0-agent
- cli: add more cli-e2e test cases (#8548) by @h-a-n-a

### ⚙️ Miscellaneous Tasks

- docs: update in-depth/directives for `output.strict` option (#8535) by @minsoo-web
- add PNPM_HOME Dev Drive mapping to Windows CI workflows (#8589) by @Boshen
- deps: update github-actions (#8588) by @renovate[bot]
- move Windows cargo target dir to Dev Drive (#8586) by @Boshen
- optimize cache keys to fix race conditions and reduce usage (#8578) by @Boshen
- remove WASI build & test pipeline (#8580) by @Boshen
- remove unnecessary submodule checkouts (#8577) by @Boshen
- use Dev Drive for Windows CI jobs (#8574) by @Boshen
- skip redundant native binding build for browser and remove standalone job (#8573) by @Boshen
- parallelize Node tests on ubuntu, single Node 24 on macOS/windows (#8570) by @Boshen
- docs: bump @voidzero-dev/vitepress-theme to 4.8.0 (#8558) by @crusty-voidzero
- dedupe type-check from dev server workflow (#8554) by @Boshen

### ❤️ New Contributors

* @brandonzylstra made their first contribution in [#8591](#8591)
* @char made their first contribution in [#8565](#8565)
* @cal-gooo made their first contribution in [#8581](#8581)
* @hyf0-agent made their first contribution in [#8562](#8562)
* @h-a-n-a made their first contribution in [#8551](#8551)

Co-authored-by: shulaoda <165626830+shulaoda@users.noreply.github.com>
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.

5 participants