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 3529732.8 Ops/sec
clsx 3798609.5 Ops/sec
Array based 2636233.5 Ops/sec
String based (return struct) 3490957.2 Ops/sec
String based (if-else struct) 3427088.5 Ops/sec
Entries, filter, map, join 2933095.0 Ops/sec
String literally 398641568.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