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) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36
Browser:
Chrome 138
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Nullish coalescing (??)
174.5M/s
Logical OR (||)
168.3M/s
Nullish coalescing (??) [short-circuit]
142.3M/s
Logical OR (||) [short-circuit]
120.0M/s
View exact numbers
Test name
Executions per second
✓
Nullish coalescing (??)
174,506,304 Ops/sec
Logical OR (||)
168,285,808 Ops/sec
Nullish coalescing (??) [short-circuit]
142,252,176 Ops/sec
Logical OR (||) [short-circuit]
119,956,064 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;