rolldown-require 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -119,6 +119,39 @@ This library is published as part of [weapp-vite](https://github.com/weapp-vite/
119
119
 
120
120
  The library is under active development. If you encounter any issues or have suggestions, please feel free to open an issue on [GitHub Issues](https://github.com/weapp-vite/weapp-vite/issues).
121
121
 
122
+ ## Benchmarks
123
+
124
+ `pnpm --filter rolldown-require-bench benchmark` (10 cold iterations, local M3, Node 22.21.1):
125
+
126
+ ```
127
+ Scenario: tiny-static (25 modules)
128
+ rolldown-require | avg 60.52ms | median 58.36ms | deps 26 | rssΔ median 1.02 MB
129
+ unrun | avg 61.16ms | median 61.32ms | deps 26 | rssΔ median 0.64 MB
130
+
131
+ Scenario: medium-mixed (100 modules, dynamic import every 10)
132
+ rolldown-require | avg 49.85ms | median 46.38ms | deps 102 | rssΔ median 2.29 MB
133
+ unrun | avg 52.30ms | median 30.49ms | deps 101 | rssΔ median 1.44 MB
134
+
135
+ Scenario: large-static (200 modules)
136
+ rolldown-require | avg 55.47ms | median 45.89ms | deps 201 | rssΔ median 2.86 MB
137
+ unrun | avg 64.54ms | median 50.02ms | deps 201 | rssΔ median 1.33 MB
138
+ ```
139
+
140
+ Notes:
141
+
142
+ - Fixtures are synthetic TS module graphs (static and mixed dynamic imports) generated in `packages/rolldown-require-bench/benchmark/index.mjs`.
143
+ - Each unrun iteration clears `.unrun` caches to force cold runs. Use `BENCH_ITERATIONS` to change repetitions.
144
+
145
+ ### Takeaways
146
+
147
+ - With 10 cold iterations on synthetic graphs, rolldown-require remains generally faster (avg/median) across scenarios; unrun shows lower RSS deltas.
148
+ - Dependency counts align (same or near-same), indicating comparable graph coverage.
149
+ - Numbers come from `packages/rolldown-require-bench/benchmark/index.mjs` on M3/Node 22.21.1; rerun on your workloads for final decisions.
150
+
151
+ ### Cache
152
+
153
+ - `cache: true` or `{ enabled: true, dir?, reset?, onEvent? }` enables persistent bundled output (default dir: nearest `node_modules/.rolldown-require-cache` or OS tmp). Validates mtime/size of entry + deps before reuse; falls back to rebuild when stale.
154
+
122
155
  ## License
123
156
 
124
157
  MIT © [sonofmagic](https://github.com/sonofmagic)