Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 YaBrowser/21.8.1.468 Yowser/2.5 Safari/537.36
Yandex Browser 21
Windows
Desktop
3 years ago
Test name Executions per second
classnames 1149357.5 Ops/sec
clsx 1723808.5 Ops/sec
Array based 1293791.8 Ops/sec
String based (return struct) 1673864.4 Ops/sec
String based (if-else struct) 1919150.2 Ops/sec
Entries, filter, map, join 1581677.1 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