Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 YaBrowser/21.8.0.1716 Yowser/2.5 Safari/537.36
Yandex Browser 21
Mac OS X 10.13.6
Desktop
3 years ago
Test name Executions per second
classnames 529397.8 Ops/sec
clsx 782765.9 Ops/sec
Array based 406454.5 Ops/sec
String based (return struct) 810830.8 Ops/sec
String based (if-else struct) 800287.6 Ops/sec
Entries, filter, map, join 774080.4 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