Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36
Chrome 100
Linux
Desktop
2 years ago
Test name Executions per second
classcat(arr) 1549590.6 Ops/sec
classcat(obj) 2613152.5 Ops/sec
clsx(arr) 2041969.0 Ops/sec
clsx(obj) 2346938.8 Ops/sec
objstr(obj) 2170034.5 Ops/sec
arr.filter(Boolean).join(" ") 1148840.8 Ops/sec
merge-class-names(arr) 1090364.2 Ops/sec
merge-class-names(obj) 1553941.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)