Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
objects delete vs null vs undefined vs void 0 vs Object.create(null)
(version: 0)
delete vs null vs undefined vs void 0 vs Object.create(null)
Comparing performance of:
null vs undefined vs Object.create(null) vs void 0 vs delete
Created:
2 years ago
by:
Guest
Jump to the latest result
Tests:
null
var a = 999; for(var i = 0; i < 1000;i++) { const b = {a:null}; }
undefined
var a = 999; for(var i = 0; i < 1000;i++) { const b = {a: undefined}; }
Object.create(null)
var a = 999; for(var i = 0; i < 1000;i++) { const b = {a: Object.create(null)}; }
void 0
var a = 999; for(var i = 0; i < 1000;i++) { const b = {a: void 0}; }
delete
var a = 999; for(var i = 0; i < 1000;i++) { const b = {a: void 0}; delete b.a; }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (5)
Previous results
Fork
Test case name
Result
null
undefined
Object.create(null)
void 0
delete
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36
Browser/OS:
Chrome 136 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
null
5007848.0 Ops/sec
undefined
1674187.6 Ops/sec
Object.create(null)
150887.2 Ops/sec
void 0
4965373.0 Ops/sec
delete
14620.0 Ops/sec
Related benchmarks:
Object property: delete vs undefined 2
Delete vs set undefined Properties
Object.create(null) vs Object literal
Delete vs Undefined
void 0 vs undefined vs variable containing undefined
Comments
Confirm delete:
Do you really want to delete benchmark?