HTML Preparation code:
Script Preparation code:
Tests:

Historical Performance Data aggregated from 21 community runs

Desktop Results:
Chrome 21 runs
Not empty [0]
24.5M/s
Empty [0]
23.7M/s
[0] with check
10.2M/s
Empty lodash.head()
9.8M/s
Not empty lodash.head()
9.7M/s
[0] with null check
7.2M/s

Fastest: Not empty [0] (3.4x faster)

View exact numbers
  • Not empty [0]: 24,496,080 ops/sec
  • Empty [0]: 23,744,198 ops/sec
  • [0] with check: 10,185,620 ops/sec
  • Empty lodash.head(): 9,825,416 ops/sec
  • Not empty lodash.head(): 9,733,877 ops/sec
  • [0] with null check: 7,206,290 ops/sec

Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    Not empty lodash.head()
    Not empty [0]
    Empty lodash.head()
    Empty [0]
    [0] with check
    [0] with null check

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36
Chrome 136 on Mac OS X 10.15.7
View result in a separate tab
Not empty [0]
156.1M/s
Empty [0]
153.8M/s
Empty lodash.head()
146.4M/s
Not empty lodash.head()
140.2M/s
[0] with null check
109.5M/s
[0] with check
107.0M/s
View exact numbers
Test name Executions per second
Not empty [0] 156,071,376 Ops/sec
Empty [0] 153,779,568 Ops/sec
Empty lodash.head() 146,354,288 Ops/sec
Not empty lodash.head() 140,225,968 Ops/sec
[0] with null check 109,482,064 Ops/sec
[0] with check 107,028,608 Ops/sec