Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:129.0) Gecko/20100101 Firefox/129.0
Firefox 129
Linux
Desktop
3 months ago
Test name Executions per second
classnames 1860492.0 Ops/sec
clsx 3087821.0 Ops/sec
Array based 1791640.8 Ops/sec
String based (return struct) 3736555.2 Ops/sec
String based (if-else struct) 3711073.5 Ops/sec
Entries, filter, map, join 3429366.2 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