clsx icon indicating copy to clipboard operation
clsx copied to clipboard

Performance check: Current code might be 6% or so slower that can be

Open webJose opened this issue 3 months ago • 2 comments

Definitely a low priority. See this benchmark.

It compares 3 possible code snippets to prepare the final CSS classes string. On the majority of cases, the way clsx currently does it is 6% slower in Chromium browsers. I don't have other browsers installed, so I have no idea if this is consistent across the board.

Image

If people have the time and willingness, kindly run the benchmark and report.

The eventual request would be to alter the code to use the fastest code sample.

webJose avatar Oct 08 '25 20:10 webJose

Image Image

infectiousstupidity avatar Nov 06 '25 07:11 infectiousstupidity

Image Image Image

The following results are somewhat random

Image Image

dmitrivi avatar Nov 21 '25 09:11 dmitrivi