Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 17_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/120.0.6099.101 Mobile/15E148 Safari/604.1
Chrome Mobile iOS 120
iOS 17.1
Mobile
one year ago
Test name Executions per second
classnames 3378084.8 Ops/sec
clsx 3730885.5 Ops/sec
Array based 2526901.0 Ops/sec
String based (return struct) 3302881.0 Ops/sec
String based (if-else struct) 2864800.8 Ops/sec
Entries, filter, map, join 3079428.0 Ops/sec
String literally 490506784.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