Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36 Edg/86.0.622.38
Chrome 86
Windows
Desktop
4 years ago
Test name Executions per second
classnames 617825.6 Ops/sec
clsx 610922.1 Ops/sec
Array based 615398.7 Ops/sec
String based (return struct) 881407.1 Ops/sec
String based (if-else struct) 937777.8 Ops/sec
Entries, filter, map, join 761485.3 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