Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36
Chrome 96
Linux
Desktop
2 years ago
Test name Executions per second
classnames 626672.4 Ops/sec
clsx 930838.6 Ops/sec
Array based 712389.2 Ops/sec
String based (return struct) 1059142.0 Ops/sec
String based (if-else struct) 1083647.0 Ops/sec
Entries, filter, map, join 901706.7 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