Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36
Chrome 99
Windows
Desktop
2 years ago
Test name Executions per second
classnames 1376768.0 Ops/sec
clsx 1817325.8 Ops/sec
Array based 1502126.4 Ops/sec
String based (return struct) 2055547.4 Ops/sec
String based (if-else struct) 2057420.9 Ops/sec
Entries, filter, map, join 1641977.9 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