Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36
Chrome 97
Windows
Desktop
2 years ago
Test name Executions per second
classcat(arr) 1889534.1 Ops/sec
classcat(obj) 2793652.8 Ops/sec
clsx(arr) 2470814.5 Ops/sec
clsx(obj) 3026218.5 Ops/sec
objstr(obj) 2927172.2 Ops/sec
arr.filter(Boolean).join(" ") 1299107.6 Ops/sec
merge-class-names(arr) 1246324.0 Ops/sec
merge-class-names(obj) 1708552.1 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • classcat(arr)

  • classcat(obj)

  • clsx(arr)

  • clsx(obj)

  • objstr(obj)

  • arr.filter(Boolean).join(" ")

  • merge-class-names(arr)

  • merge-class-names(obj)