Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36
Chrome 107
Windows
Desktop
2 years ago
Test name Executions per second
classnames(str) 2408030.5 Ops/sec
classnames(obj) 2174467.0 Ops/sec
classnames(arr) 1614526.9 Ops/sec
clsx(str) 3363929.5 Ops/sec
clsx(obj) 1567659.0 Ops/sec
clsx(arr) 988736.5 Ops/sec
classcat(str) 1290184.4 Ops/sec
classcat(obj) 966977.4 Ops/sec
classcat(arr) 858172.2 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • classnames(str)

  • classnames(obj)

  • classnames(arr)

  • clsx(str)

  • clsx(obj)

  • clsx(arr)

  • classcat(str)

  • classcat(obj)

  • classcat(arr)