Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Nullish coalescing (??) vs logical OR (||)
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0
Browser:
Firefox 131
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Logical OR (||)
1802.7M/s
Nullish coalescing (??) [short-circuit]
1800.3M/s
Logical OR (||) [short-circuit]
1757.2M/s
Nullish coalescing (??)
899.6M/s
View exact numbers
Test name
Executions per second
✓
Logical OR (||)
1,802,666,624 Ops/sec
Nullish coalescing (??) [short-circuit]
1,800,261,760 Ops/sec
Logical OR (||) [short-circuit]
1,757,212,672 Ops/sec
Nullish coalescing (??)
899,616,896 Ops/sec
Tests:
Nullish coalescing (??)
let x = null ?? undefined ?? null ?? undefined ?? null ?? undefined ?? null ?? undefined ?? null ?? undefined ?? 1;
Logical OR (||)
let x = null || undefined || null || undefined || null || undefined || null || undefined || null || undefined || 1;
Nullish coalescing (??) [short-circuit]
let x = 1 ?? undefined ?? null ?? undefined ?? null ?? undefined ?? null ?? undefined ?? null ?? undefined ?? 1;
Logical OR (||) [short-circuit]
let x = 1 || undefined || null || undefined || null || undefined || null || undefined || null || undefined || 1;