Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36
Chrome 89
Linux
Desktop
3 years ago
Test name Executions per second
classnames 801518.2 Ops/sec
clsx 1164273.0 Ops/sec
Array based 1053877.1 Ops/sec
String based (return struct) 1430867.1 Ops/sec
String based (if-else struct) 1357648.8 Ops/sec
Entries, filter, map, join 1189487.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