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

[3.x] Cache results for TranslationServer.compare_locales() #98234

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

timothyqiu
Copy link
Member

Resolves #98228

The score for the match between two locales does not change with external circumstances. We can cache the result to avoid doing heavy string operations like split() repeatedly.

FPS is about seven times what it was before the change using the MRP here:

Build Before After
dev 3 23
release 30 210

@timothyqiu timothyqiu added enhancement topic:core cherrypick:3.6 Considered for cherry-picking into a future 3.6.x release labels Oct 16, 2024
@timothyqiu timothyqiu added this to the 3.7 milestone Oct 16, 2024
@timothyqiu timothyqiu requested a review from a team as a code owner October 16, 2024 12:32
@lawnjelly
Copy link
Member

This looks great! Do we know which PR caused this regression in performance out of interest?

@timothyqiu
Copy link
Member Author

compare_locales() was introduced by #61878.

@lawnjelly lawnjelly merged commit 3841d76 into godotengine:3.x Oct 17, 2024
14 checks passed
@lawnjelly
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherrypick:3.6 Considered for cherry-picking into a future 3.6.x release enhancement topic:core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants