Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36
Chrome 122
Linux
Desktop
9 months ago
Test name Executions per second
classnames 354876.8 Ops/sec
clsx 559329.4 Ops/sec
Array based 555522.4 Ops/sec
String based (return struct) 696136.6 Ops/sec
String based (if-else struct) 724456.2 Ops/sec
Entries, filter, map, join 655180.6 Ops/sec
String literally 44842224.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