Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Object.assign vs. JSON String/Parse deeper object
Creating a "new" object reference every time
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Browser:
Chrome 124
Operating system:
Linux
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
Spread operator
2408653.5 Ops/sec
JSON Parse
2369765.5 Ops/sec
Object.assign
2254740.0 Ops/sec
Tests:
Spread operator
var n = {"foo":"bar","objectinobject":{"obj1":{"hello":"world","foo":"bar"},"arra":[1,2,3,4,5,6],"hello":[{"hello":"world","foo":"bar"},{"hello":"world","foo":"bar"},{"hello":"world","foo":"bar"},{"hello":"world","foo":"bar"}]},"hello":[{"hello":"world","foo":"bar"},{"hello":"world","foo":"bar"},{"hello":"world","foo":"bar"},{"hello":"world","foo":"bar"}]}; while(n.length < 1000) { n = [...n]; }
JSON Parse
var n = {"foo":"bar","objectinobject":{"obj1":{"hello":"world","foo":"bar"},"arra":[1,2,3,4,5,6],"hello":[{"hello":"world","foo":"bar"},{"hello":"world","foo":"bar"},{"hello":"world","foo":"bar"},{"hello":"world","foo":"bar"}]},"hello":[{"hello":"world","foo":"bar"},{"hello":"world","foo":"bar"},{"hello":"world","foo":"bar"},{"hello":"world","foo":"bar"}]}; while(n.length < 1000) { n = JSON.parse(JSON.stringify(n)) }
Object.assign
var n = {"foo":"bar","objectinobject":{"obj1":{"hello":"world","foo":"bar"},"arra":[1,2,3,4,5,6],"hello":[{"hello":"world","foo":"bar"},{"hello":"world","foo":"bar"},{"hello":"world","foo":"bar"},{"hello":"world","foo":"bar"}]},"hello":[{"hello":"world","foo":"bar"},{"hello":"world","foo":"bar"},{"hello":"world","foo":"bar"},{"hello":"world","foo":"bar"}]}; while(n.length < 1000) { n = Object.assign({}, n); }