Tests:
  • Nullish coalescing (??)

    AخA
     
    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;
  • JS Compiled ?? (?:)

     
    var _a, _b, _c, _d, _e, _f, _g, _h, _j;
    let x = (_j = (_h = (_g = (_f = (_e = (_d = (_c = (_b = (_a = null !== null && null !== void 0 ? null : undefined) !== null && _a !== void 0 ? _a : null) !== null && _b !== void 0 ? _b : undefined) !== null && _c !== void 0 ? _c : null) !== null && _d !== void 0 ? _d : undefined) !== null && _e !== void 0 ? _e : null) !== null && _f !== void 0 ? _f : undefined) !== null && _g !== void 0 ? _g : null) !== null && _h !== void 0 ? _h : undefined) !== null && _j !== void 0 ? _j : 1;
  • JS Compiled ?? (?:) [short-circuit]

     
    var _a, _b, _c, _d, _e, _f, _g, _h, _j;
    let x = (_j = (_h = (_g = (_f = (_e = (_d = (_c = (_b = (_a = 1 !== null && 1 !== void 0 ? 1 : undefined) !== null && _a !== void 0 ? _a : null) !== null && _b !== void 0 ? _b : undefined) !== null && _c !== void 0 ? _c : null) !== null && _d !== void 0 ? _d : undefined) !== null && _e !== void 0 ? _e : null) !== null && _f !== void 0 ? _f : undefined) !== null && _g !== void 0 ? _g : null) !== null && _h !== void 0 ? _h : undefined) !== null && _j !== void 0 ? _j : 1;
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Nullish coalescing (??)
    Logical OR (||)
    Nullish coalescing (??) [short-circuit]
    Logical OR (||) [short-circuit]
    JS Compiled ?? (?:)
    JS Compiled ?? (?:) [short-circuit]

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one month ago)
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Mobile Safari/537.36 EdgA/132.0.0.0
Chrome Mobile 132 on Android
View result in a separate tab
Test name Executions per second
Nullish coalescing (??) 84215360.0 Ops/sec
Logical OR (||) 83704592.0 Ops/sec
Nullish coalescing (??) [short-circuit] 107816688.0 Ops/sec
Logical OR (||) [short-circuit] 106414608.0 Ops/sec
JS Compiled ?? (?:) 76080736.0 Ops/sec
JS Compiled ?? (?:) [short-circuit] 107635392.0 Ops/sec