Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
Chrome 114
Mac OS X 10.15.7
Desktop
one year ago
Test name Executions per second
classcat(arr) 3846952.5 Ops/sec
classcat(obj) 6859977.5 Ops/sec
clsx(arr) 5479892.0 Ops/sec
clsx(obj) 7148922.0 Ops/sec
objstr(obj) 6889321.5 Ops/sec
arr.filter(Boolean).join(" ") 3604847.8 Ops/sec
merge-class-names(arr) 3844910.0 Ops/sec
merge-class-names(obj) 5024234.5 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)