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; Ubuntu; Linux x86_64; rv:130.0) Gecko/20100101 Firefox/130.0
Browser:
Firefox 130
Operating system:
Ubuntu
Device Platform:
Desktop
Date tested:
one year ago
Logical OR (||) [short-circuit]
2039.1M/s
Nullish coalescing (??) [short-circuit]
2032.5M/s
Logical OR (||)
1999.9M/s
Nullish coalescing (??)
1287.7M/s
View exact numbers
Test name
Executions per second
✓
Logical OR (||) [short-circuit]
2,039,145,472 Ops/sec
Nullish coalescing (??) [short-circuit]
2,032,488,832 Ops/sec
Logical OR (||)
1,999,920,384 Ops/sec
Nullish coalescing (??)
1,287,723,264 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;