Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36
Chrome 99
Linux
Desktop
2 years ago
Test name Executions per second
classnames 843402.6 Ops/sec
clsx 1439253.4 Ops/sec
Array based 1055213.9 Ops/sec
String based (return struct) 1369004.9 Ops/sec
String based (if-else struct) 1266275.0 Ops/sec
Entries, filter, map, join 1066312.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