Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Join vs JSON.Stringify
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/119.0.0.0 Safari/537.36
Browser:
Chrome 119
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
Join
4188.1 Ops/sec
Stringify
2595.7 Ops/sec
Script Preparation code:
var smallArray = Array.from({ length: 10 }).map((_, i) => `test_val${i}`); var bigArray = Array.from({ length: 10000 }).map((_, i) => `test_val${i}`);
Tests:
Join
const s1 = smallArray.sort().join(',') const b1 = bigArray.sort().join(',')
Stringify
const s2 = JSON.stringify(smallArray.sort()) const b2 = JSON.stringify(bigArray.sort())