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 (Windows NT 10.0; Win64; x64; rv:136.0) Gecko/20100101 Firefox/136.0
Browser:
Firefox 136
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Nullish coalescing (??) [short-circuit]
1640.3M/s
Logical OR (||) [short-circuit]
1638.8M/s
Logical OR (||)
1578.3M/s
Nullish coalescing (??)
1107.6M/s
View exact numbers
Test name
Executions per second
✓
Nullish coalescing (??) [short-circuit]
1,640,271,232 Ops/sec
Logical OR (||) [short-circuit]
1,638,822,656 Ops/sec
Logical OR (||)
1,578,302,336 Ops/sec
Nullish coalescing (??)
1,107,588,736 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;