Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36
Chrome 87
Mac OS X 11.1.0
Desktop
3 years ago
Test name Executions per second
classnames 1205108.9 Ops/sec
clsx 1694564.4 Ops/sec
Array based 1356545.0 Ops/sec
String based (return struct) 1919134.4 Ops/sec
String based (if-else struct) 1885269.5 Ops/sec
Entries, filter, map, join 1596236.6 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • classnames

  • clsx

  • Array based

  • String based (return struct)

  • String based (if-else struct)

  • Entries, filter, map, join