Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36
Chrome 123
Linux
Desktop
7 months ago
Test name Executions per second
classnames 3224470.0 Ops/sec
clsx 4773233.5 Ops/sec
Array based 3392430.5 Ops/sec
String based (return struct) 4549986.5 Ops/sec
String based (if-else struct) 4557759.5 Ops/sec
Entries, filter, map, join 4076863.0 Ops/sec
String literally 204821040.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