Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:93.0) Gecko/20100101 Firefox/93.0
Firefox 93
Mac OS X 10.15
Desktop
3 years ago
Test name Executions per second
classnames 2411002.2 Ops/sec
clsx 3427695.5 Ops/sec
Array based 2269260.2 Ops/sec
String based (return struct) 3183023.2 Ops/sec
String based (if-else struct) 3290238.2 Ops/sec
Entries, filter, map, join 3135653.2 Ops/sec
String literally 1549342848.0 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

  • String literally


;