Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
Object literal vs JSON.parse
As long as the JSON string is only evaluated once, the JSON.parse approach is much faster compared to the JavaScript object literal, especially for cold loads.
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.2 Mobile/15E148 Safari/604.1
Browser:
Mobile Safari 26
Operating system:
iOS 18.7
Device Platform:
Mobile
Date tested:
9 months ago
Benchmark engine:
Benchmark.js
Object literal test
435.9M/s
Json parse
16.8M/s
View exact numbers
Test name
Executions per second
✓
Object literal test
435,856,224 Ops/sec
Json parse
16,820,216 Ops/sec
Tests:
Object literal test
const literal = { foo: 42, bar: 1337 }; literal.foo;
Json parse
const json = JSON.parse('{"foo":42,"bar":1337}'); json.foo;