Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:95.0) Gecko/20100101 Firefox/95.0
Firefox 95
Mac OS X 10.15
Desktop
2 years ago
Test name Executions per second
classnames 1020003.1 Ops/sec
clsx 1962321.1 Ops/sec
Array based 949105.2 Ops/sec
String based (return struct) 1693440.6 Ops/sec
String based (if-else struct) 1626967.6 Ops/sec
Entries, filter, map, join 1642403.0 Ops/sec
String literally 666810304.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