Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0
Firefox 121
Windows
Desktop
one year ago
Test name Executions per second
classnames 2499201.0 Ops/sec
clsx 4311302.5 Ops/sec
Array based 2747776.8 Ops/sec
String based (return struct) 5686046.0 Ops/sec
String based (if-else struct) 5845346.5 Ops/sec
Entries, filter, map, join 5513070.5 Ops/sec
String literally 1530713216.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