Skip to content

Conversation

@RobinMalfait
Copy link
Member

@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
@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.

3 participants