Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
JSON.stringify array vs join Updated
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36
Browser:
Chrome 128
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
JSON.stringify
2958.7 Ops/sec
array.join + string template
3404.6 Ops/sec
Script Preparation code:
var arr_small = Array.from({ length: 10 }).map((_, i) => `test_val${i}`); var arr_big = Array.from({ length: 10000 }).map((_, i) => `test_val${i}`);
Tests:
JSON.stringify
JSON.stringify(arr_small); JSON.stringify(arr_big);
array.join + string template
`["${arr_small.join('","')}"]`; `["${arr_big.join('","')}"]`;