classnames recently had some performance optimizing changes, it might therefore be a good idea to update the benchmarks with some more recent versions. From my testing on Node.js (haven't tested browsers) both classcat and classnames have seen significant performance boosts:
# Strings
classcat* x 14,797,704 ops/sec ±0.34% (97 runs sampled)
classnames x 16,512,233 ops/sec ±0.28% (99 runs sampled)
clsx (prev) x 15,628,285 ops/sec ±0.54% (95 runs sampled)
clsx x 17,359,926 ops/sec ±0.49% (99 runs sampled)
# Objects
classcat* x 13,320,894 ops/sec ±0.62% (93 runs sampled)
classnames x 13,160,650 ops/sec ±0.17% (96 runs sampled)
clsx (prev) x 10,128,094 ops/sec ±0.26% (94 runs sampled)
clsx x 12,825,083 ops/sec ±0.32% (98 runs sampled)
# Arrays
classcat* x 12,363,081 ops/sec ±0.46% (95 runs sampled)
classnames x 10,704,461 ops/sec ±0.33% (93 runs sampled)
clsx (prev) x 11,650,643 ops/sec ±0.20% (99 runs sampled)
clsx x 12,396,335 ops/sec ±0.19% (97 runs sampled)
# Nested Arrays
classcat* x 9,529,380 ops/sec ±1.14% (96 runs sampled)
classnames x 6,569,058 ops/sec ±0.26% (100 runs sampled)
clsx (prev) x 8,874,776 ops/sec ±0.47% (96 runs sampled)
clsx x 8,971,678 ops/sec ±0.40% (98 runs sampled)
# Nested Arrays w/ Objects
classcat* x 9,831,044 ops/sec ±0.56% (91 runs sampled)
classnames x 9,347,581 ops/sec ±0.34% (94 runs sampled)
clsx (prev) x 8,700,574 ops/sec ±0.32% (99 runs sampled)
clsx x 10,073,516 ops/sec ±0.58% (97 runs sampled)
# Mixed
classcat* x 10,498,507 ops/sec ±0.56% (92 runs sampled)
classnames x 10,229,073 ops/sec ±0.52% (97 runs sampled)
clsx (prev) x 9,538,485 ops/sec ±0.48% (97 runs sampled)
clsx x 10,647,664 ops/sec ±1.88% (95 runs sampled)
# Mixed (Bad Data)
classcat* x 2,449,938 ops/sec ±0.28% (97 runs sampled)
classnames x 2,780,279 ops/sec ±0.25% (97 runs sampled)
clsx (prev) x 2,815,139 ops/sec ±0.30% (98 runs sampled)
clsx x 3,080,118 ops/sec ±0.27% (98 runs sampled)
classnames
recently had some performance optimizing changes, it might therefore be a good idea to update the benchmarks with some more recent versions. From my testing on Node.js (haven't tested browsers) bothclasscat
andclassnames
have seen significant performance boosts: