Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Further improve natural sorting of classes #13532

Merged
merged 3 commits into from Apr 16, 2024

Conversation

RobinMalfait
Copy link
Contributor

@RobinMalfait RobinMalfait commented Apr 16, 2024

This PR is a small continuation of #13507 where @rvanvelzen pointed out that we are checking a character that we already compared.

Additionally, this PR also prevents re-computing the charCode twice.

Performance wise, this is very minimal, running this on the tailwindcss.com codebase I get these results:

Before:

[3.19ms] Sort
[3.06ms] Sort
[3.13ms] Sort
[3.38ms] Sort
[3.11ms] Sort
[3.05ms] Sort
[3.03ms] Sort
[3.02ms] Sort
[2.96ms] Sort
[3.18ms] Sort
-------------
[3.171ms] avg

After:

[3.24ms] Sort
[3.02ms] Sort
[3.14ms] Sort
[3.05ms] Sort
[3.17ms] Sort
[3.09ms] Sort
[3.02ms] Sort
[3.12ms] Sort
[2.94ms] Sort
[2.97ms] Sort
-------------
[3.076ms] avg

RobinMalfait and others added 3 commits April 16, 2024 17:54
@RobinMalfait RobinMalfait changed the title Improve natural sorting classes Further improve natural sorting of classes Apr 16, 2024
@RobinMalfait RobinMalfait merged commit cc8c069 into next Apr 16, 2024
1 check passed
@RobinMalfait RobinMalfait deleted the feat/further-improve-compare branch April 16, 2024 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants