Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36
Chrome 83
Mac OS X 10.14.6
Desktop
4 years ago
Test name Executions per second
classnames 977386.3 Ops/sec
clsx 1415587.6 Ops/sec
Array based 1039987.9 Ops/sec
String based (return struct) 1464243.1 Ops/sec
String based (if-else struct) 1489582.2 Ops/sec
Entries, filter, map, join 1230363.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