Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 17_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/124.0.6367.111 Mobile/15E148 Safari/604.1
Chrome Mobile iOS 124
iOS 17.4
Mobile
7 months ago
Test name Executions per second
classnames 2592178.5 Ops/sec
clsx 2910467.2 Ops/sec
Array based 1671126.6 Ops/sec
String based (return struct) 2275103.5 Ops/sec
String based (if-else struct) 2543256.0 Ops/sec
Entries, filter, map, join 2170000.0 Ops/sec
String literally 452312928.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