Script Preparation code:
Tests:
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    Double negation (!!row.length) with destructuring
    Double negation (!!row.length) without destructuring
    Comparison (row.length > 0) with destructuring
    Comparison (row.length > 0) without destructuring
    Double negation (!!row)
    Boolean constructor
    Array.length property
    Array.some() method
    Object.keys()
    for...of loop
    Array.isArray() with length
    typeof with length
    First element check
    Length property cast with destructuring
    Length property cast without destructuring

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Chrome 131 on Windows
View result in a separate tab
Length property cast with destructuring
156K/s
Length property cast without destructuring
155K/s
Comparison (row.length > 0) without destructuring
154K/s
Double negation (!!row.length) with destructuring
154K/s
Array.length property
154K/s
Comparison (row.length > 0) with destructuring
153K/s
Array.some() method
152K/s
Double negation (!!row.length) without destructuring
152K/s
for...of loop
152K/s
First element check
151K/s
Array.isArray() with length
150K/s
typeof with length
145K/s
Boolean constructor
128K/s
Double negation (!!row)
118K/s
Object.keys()
694/s
View exact numbers
Test name Executions per second
Length property cast with destructuring 155,992 Ops/sec
Length property cast without destructuring 155,273 Ops/sec
Comparison (row.length > 0) without destructuring 154,273 Ops/sec
Double negation (!!row.length) with destructuring 154,256 Ops/sec
Array.length property 153,668 Ops/sec
Comparison (row.length > 0) with destructuring 152,593 Ops/sec
Array.some() method 152,293 Ops/sec
Double negation (!!row.length) without destructuring 152,011 Ops/sec
for...of loop 151,516 Ops/sec
First element check 150,875 Ops/sec
Array.isArray() with length 150,011 Ops/sec
typeof with length 145,367 Ops/sec
Boolean constructor 128,206 Ops/sec
Double negation (!!row) 117,825 Ops/sec
Object.keys() 694 Ops/sec