Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Object literal vs Object.create(null)
compare performance of object creating non-empty objects using object literal vs Object.create
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Linux; Android 13; ASUS_I006D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.5993.111 Mobile Safari/537.36 OPR/79.0.4172.75690
Browser:
Opera Mobile 79
Operating system:
Android
Device Platform:
Mobile
Date tested:
2 years ago
Test name
Executions per second
Object.create(null)
175.8 Ops/sec
object literal
2745.9 Ops/sec
Tests:
Object.create(null)
const a = []; for (let i = 0; i < 10000; i++) { const o = Object.create(null) o.x = 'a string' o.y = 17 o.z = { m: 'an object', n: 97 } a.push( o ) }
object literal
const a = []; for (let i = 0; i < 10000; i++) { const o = { x: 'a string' } o.y = 17 o.z = { m: 'an object', n: 97 } a.push( o ) }