Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
Undefined vs null
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36
Browser:
Chrome 133
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Benchmark engine:
Benchmark.js
setting undefined
44K/s
setting null
44K/s
View exact numbers
Test name
Executions per second
✓
setting undefined
44,489 Ops/sec
setting null
43,529 Ops/sec
Script Preparation code:
function ctor() { var obj = { a: { a: 5 }, b: { b: 5 }, c: { c: 6 }, d: 5, e: [Math.random(), Math.random()] }; return obj; }
Tests:
setting null
var objects = []; for (var i = 0; i < 1000; i++) { objects[i] = ctor(); } var obj = objects[Math.floor(Math.random() * 1000)]; window.leak = obj.a + obj.b + obj.c + obj.d + obj.e; for (var i = 0; i < 1000; i++) { obj.a = null; obj.b = null; obj.c = null; obj.d = null; obj.e = null; }
setting undefined
var objects = []; for (var i = 0; i < 1000; i++) { objects[i] = ctor(); } var obj = objects[Math.floor(Math.random() * 1000)]; window.leak = obj.a + obj.b + obj.c + obj.d + obj.e; for (var i = 0; i < 1000; i++) { obj.a = void 0; obj.b = void 0; obj.c = void 0; obj.d = void 0; obj.e = void 0; }