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

Performance boost: better function sorting during validation #651

Merged
merged 3 commits into from
Aug 2, 2022

Conversation

TwitchBronBron
Copy link
Member

When validating scopes, we collect all the callable functions, and then sort them by file and function name so that the diagnostics appear in the same order every time. However, it uses localeCompare several times, which seems to be very slow. Since it's only about providing consistency, this doesn't need to be locale aware or overly precise.

This PR refactors the sorting function to use native string sorting instead, yielding slightly better performance.

Roku-GooglePhotos:
image

Jellyfin-roku:
image

An internal Fubo app:
image

@TwitchBronBron TwitchBronBron merged commit a31e1be into master Aug 2, 2022
@TwitchBronBron TwitchBronBron deleted the perf-fix-callable-sort branch August 2, 2022 14:22
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