Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36
Chrome 101
Windows
Desktop
2 years ago
Test name Executions per second
classcat(arr) 2476915.5 Ops/sec
classcat(obj) 3474823.0 Ops/sec
clsx(arr) 3112532.8 Ops/sec
clsx(obj) 4139705.5 Ops/sec
objstr(obj) 3926836.8 Ops/sec
arr.filter(Boolean).join(" ") 2126624.8 Ops/sec
merge-class-names(arr) 2041810.0 Ops/sec
merge-class-names(obj) 2218944.8 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)