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

[localization-plugin] Improve localized asset construction performance by 50% #4862

Merged
merged 2 commits into from
Aug 6, 2024

Conversation

dmichon-msft
Copy link
Contributor

Summary

Applies some preliminary checks to localized replacement strings before invoking string.replace to avoid allocating unnecessary strings when there are no characters that need escaping.

Details

The calls to string.replace are expensive and most localized strings don't contain \, ", ', \t, \n or \r.

How it was tested

Unit tests for behavior.

Before:
image

After:
image

Impacted documentation

None.

@dmichon-msft dmichon-msft enabled auto-merge (squash) August 6, 2024 20:02
@dmichon-msft dmichon-msft merged commit 5f75154 into main Aug 6, 2024
5 checks passed
@dmichon-msft dmichon-msft deleted the localization-plugin-perf branch August 6, 2024 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

3 participants