Performance check: Current code might be 6% or so slower that can be
- Dominant language
- JavaScript
- Stars
- 9.8k
- Forks
- 185
- PR merge metrics
- No merged PRs in 30d
Description
Definitely a low priority. See [this benchmark](https://jsperf.app/votezu).
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.
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.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by running the linked jsPerf benchmark and reviewing the three snippets it compares for preparing the final CSS classes string. Check results across available browsers before considering a change to clsx’s current implementation. Done means a validated faster approach with no regression in the utility’s existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- performance
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100