Commit 4732a16
committed
perf(testing): share tokio runtime across fixture tests (#8567)
## 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)1 parent 290a715 commit 4732a16
File tree
3 files changed
+24
-6
lines changed- crates
- rolldown_dev/src
- rolldown_testing/src
3 files changed
+24
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
362 | 362 | | |
363 | 363 | | |
364 | 364 | | |
365 | | - | |
366 | | - | |
367 | | - | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
368 | 373 | | |
369 | 374 | | |
370 | 375 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
19 | 25 | | |
20 | 26 | | |
21 | 27 | | |
| |||
36 | 42 | | |
37 | 43 | | |
38 | 44 | | |
39 | | - | |
| 45 | + | |
40 | 46 | | |
41 | 47 | | |
42 | 48 | | |
43 | | - | |
| 49 | + | |
44 | 50 | | |
45 | 51 | | |
46 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
363 | 363 | | |
364 | 364 | | |
365 | 365 | | |
366 | | - | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
367 | 374 | | |
368 | 375 | | |
369 | 376 | | |
| |||
0 commit comments