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

[5.x] Adjust sorting and comparison implementations #9692

Merged
merged 2 commits into from
Mar 14, 2024
Merged

[5.x] Adjust sorting and comparison implementations #9692

merged 2 commits into from
Mar 14, 2024

Conversation

JohnathonKoster
Copy link
Contributor

This PR makes adjustments to the sorting and comparison implementation. For the multisort implementation itself, it prepares the sort column and direction outside of the uasort callback to reduce the number of explode calls. Additionally, it resolves the Compare instance once from the service container and reuses it.

For the Comparator, it moves the class_exists(Collator::class) call out of the strings method. The Str::lower calls were also refactored to just mb_strtolower.

These combined changes reduced control panel load times by ~ 1.5-2 seconds for 20K+ entries.

@JohnathonKoster JohnathonKoster mentioned this pull request Mar 9, 2024
37 tasks
@jasonvarga jasonvarga merged commit 33b51ab into statamic:master Mar 14, 2024
16 checks passed
@jasonvarga jasonvarga deleted the adjust-sorting-implementations branch March 14, 2024 20:42
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.

2 participants