Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:92.0) Gecko/20100101 Firefox/92.0
Firefox 92
Mac OS X 10.15
Desktop
3 years ago
Test name Executions per second
classnames 894801.2 Ops/sec
clsx 1739712.6 Ops/sec
Array based 820151.1 Ops/sec
String based (return struct) 1353620.8 Ops/sec
String based (if-else struct) 1437716.1 Ops/sec
Entries, filter, map, join 1534452.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