Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:138.0) Gecko/20100101 Firefox/138.0
Firefox 138
Mac OS X 10.15
Desktop
one year ago
Benchmark.js
Helper function for each className
109.0M/s
Reduce but no template string
22.7M/s
Reduce but with optimized parameters
22.2M/s
Reduce
21.7M/s
Join only valid strings
15.4M/s
Filter and join
9.8M/s
Join and replace false
9.5M/s
View exact numbers
Test name Executions per second
Helper function for each className 109,020,304 Ops/sec
Reduce but no template string 22,668,918 Ops/sec
Reduce but with optimized parameters 22,206,242 Ops/sec
Reduce 21,684,004 Ops/sec
Join only valid strings 15,350,356 Ops/sec
Filter and join 9,785,092 Ops/sec
Join and replace false 9,487,267 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests: