HTML Preparation code:
Script Preparation code:
Tests:

Historical Performance Data aggregated from 36 community runs

Desktop Results:
Chrome 36 runs
_.compact
9.6M/s
filter(Boolean)
7.6M/s

Fastest: _.compact (1.3x faster)

View exact numbers
  • _.compact: 9,580,706 ops/sec
  • filter(Boolean): 7,605,521 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
    _.compact
    filter(Boolean)

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 9 months ago)
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Chrome 142 on Linux
View result in a separate tab
_.compact
42.1M/s
filter(Boolean)
36.5M/s
View exact numbers
Test name Executions per second
_.compact 42,094,860 Ops/sec
filter(Boolean) 36,469,500 Ops/sec