> node benchmarks/stringify-chunked 1 # use benchmarks/fixture/medium.json (~13.7MB)
+
```
-Benchmark: stringifyStream() (JSON.stringify() as a stream)
-Node version: 20.14.0
+Benchmark: stringifyChunked() (JSON.stringify() as a stream of chunks)
+Node version: 22.5.1
Fixture: fixture/medium.json 13.69MB
# JSON.stringify()
Result: 13693862
-time: 24 ms
-cpu: 16 ms
-mem impact: rss +3.47MB | heapTotal +262kB | heapUsed -166kB | external +56
- max: rss +3.05MB | heapTotal 0 | heapUsed +14.43MB | external +56
+time: 42 ms
+cpu: 32 ms
+mem impact: rss +57.31MB | heapTotal 0 | heapUsed +50kB | external +56
+ max: rss +84.41MB | heapTotal +27.39MB | heapUsed +27.46MB | external +56
# @discoveryjs/json-ext stringifyChunked()
Result: 13693862
-time: 43 ms
-cpu: 73 ms
-mem impact: rss +8.55MB | heapTotal +262kB | heapUsed -167kB | external +56
- max: rss +8.52MB | heapTotal 0 | heapUsed +11.95MB | external +56
+time: 40 ms
+cpu: 65 ms
+mem impact: rss +10.67MB | heapTotal 0 | heapUsed +97kB | external +56
+ max: rss +10.65MB | heapTotal 0 | heapUsed +9.74MB | external +56
# @discoveryjs/json-ext createStringifyWebStream()
Result: 13693862
-time: 49 ms
-cpu: 77 ms
-mem impact: rss +8.75MB | heapTotal +262kB | heapUsed +215kB | external +160kB
- max: rss +8.70MB | heapTotal 0 | heapUsed +13.94MB | external +160kB
+time: 46 ms
+cpu: 73 ms
+mem impact: rss +12.34MB | heapTotal +524kB | heapUsed +553kB | external +160kB
+ max: rss +12.16MB | heapTotal +786kB | heapUsed +11.93MB | external +160kB
+
+# @discoveryjs/json-ext v0.6.0 stringifyChunked()
+Result: 13693862
+time: 40 ms
+cpu: 63 ms
+mem impact: rss +9.47MB | heapTotal 0 | heapUsed +99kB | external +56
+ max: rss +9.37MB | heapTotal +262kB | heapUsed +12.04MB | external +56
+
+# @discoveryjs/json-ext v0.5.7 stringifyStream()
+Result: 13693865
+time: 70 ms
+cpu: 89 ms
+mem impact: rss +13.32MB | heapTotal +262kB | heapUsed +183kB | external +56
+ max: rss +13.14MB | heapTotal +262kB | heapUsed +15.16MB | external +3.20MB
# json-stream-stringify
Result: 13693862
-time: 77 ms
-cpu: 113 ms
-mem impact: rss +7.95MB | heapTotal +262kB | heapUsed +135kB | external +56
- max: rss +7.86MB | heapTotal 0 | heapUsed +16.47MB | external +56
+time: 50 ms
+cpu: 84 ms
+mem impact: rss +9.72MB | heapTotal +524kB | heapUsed +192kB | external +56
+ max: rss +9.63MB | heapTotal +786kB | heapUsed +14.18MB | external +56
# bfj
Result: 13693862
-time: 3961 ms
-cpu: 1233 ms
-mem impact: rss +10.80MB | heapTotal +786kB | heapUsed +942kB | external +56
- max: rss +10.68MB | heapTotal +1.84MB | heapUsed +17.62MB | external +56
+time: 2172 ms
+cpu: 850 ms
+mem impact: rss +18.22MB | heapTotal +1.84MB | heapUsed +1.07MB | external +3kB
+ max: rss +18.12MB | heapTotal +2.36MB | heapUsed +17.90MB | external +3kB
```
-
+