Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36 Edg/99.0.1150.46
Chrome 99
Windows
Desktop
2 years ago
Test name Executions per second
classnames 1293183.0 Ops/sec
clsx 1834705.4 Ops/sec
Array based 1430184.9 Ops/sec
String based (return struct) 1976537.2 Ops/sec
String based (if-else struct) 1963130.1 Ops/sec
Entries, filter, map, join 1591133.6 Ops/sec
String literally 977112512.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