Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/111.0
Firefox 111
Mac OS X 10.15
Desktop
one year ago
Test name Executions per second
classnames 3099278.0 Ops/sec
clsx 4475499.0 Ops/sec
Array based 3078733.2 Ops/sec
String based (return struct) 4810748.5 Ops/sec
String based (if-else struct) 4807278.0 Ops/sec
Entries, filter, map, join 4518630.0 Ops/sec
String literally 1565736960.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