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:132.0) Gecko/20100101 Firefox/132.0
Browser:
Firefox 132
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Logical OR (||)
2332.6M/s
Logical OR (||) [short-circuit]
2318.9M/s
Nullish coalescing (??) [short-circuit]
2306.5M/s
Nullish coalescing (??)
977.3M/s
View exact numbers
Test name
Executions per second
✓
Logical OR (||)
2,332,627,712 Ops/sec
Logical OR (||) [short-circuit]
2,318,943,232 Ops/sec
Nullish coalescing (??) [short-circuit]
2,306,545,408 Ops/sec
Nullish coalescing (??)
977,286,784 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;