Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0
Firefox 91
Windows
Desktop
2 years ago
Test name Executions per second
classnames 1139921.2 Ops/sec
clsx 2101719.0 Ops/sec
Array based 942877.4 Ops/sec
String based (return struct) 1664704.0 Ops/sec
String based (if-else struct) 1713204.5 Ops/sec
Entries, filter, map, join 1698117.4 Ops/sec
String literally 765881792.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


;