Run details:
Mozilla/5.0 (Linux; Android 12) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.53 Mobile Safari/537.36
Chrome Mobile 103
Android
Mobile
2 years ago
Test name Executions per second
classnames 1198952.8 Ops/sec
clsx 1577493.2 Ops/sec
Array based 1252256.8 Ops/sec
String based (return struct) 1678674.5 Ops/sec
String based (if-else struct) 1673758.2 Ops/sec
Entries, filter, map, join 1337795.5 Ops/sec
String literally 1013065408.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