Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
json stringify vs array tostring
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:121.0) Gecko/20100101 Firefox/121.0
Browser:
Firefox 121
Operating system:
Ubuntu
Device Platform:
Desktop
Date tested:
2 years ago
toString
9.0M/s
JSON.stringify
4.6M/s
View exact numbers
Test name
Executions per second
✓
toString
9,003,661 Ops/sec
JSON.stringify
4,609,454 Ops/sec
Script Preparation code:
function moreData(arr, left) { if(left === 0) return arr; else { arr.push(Math.floor(Math.random() * 256)); return moreData(arr, left - 1); } } function makeTestData() { return moreData([], 4); }
Tests:
toString
makeTestData().toString()
JSON.stringify
JSON.stringify(makeTestData());