Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36
Chrome 84
Mac OS X 10.15.3
Desktop
4 years ago
Test name Executions per second
classnames 758768.5 Ops/sec
clsx 1103064.1 Ops/sec
Array based 833515.8 Ops/sec
String based (return struct) 1213483.1 Ops/sec
String based (if-else struct) 1205462.1 Ops/sec
Entries, filter, map, join 1000653.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