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

i18n: speed up replacement regex #6072

Merged
merged 1 commit into from
Sep 20, 2018
Merged

i18n: speed up replacement regex #6072

merged 1 commit into from
Sep 20, 2018

Conversation

brendankenny
Copy link
Member

The regex we use for checking if there are strings in the LHR that need to be replaced with their localized version can be really slow against giant strings. Adding a pre-pass with a fast regex is one easy approach to speeding this up without changing our ID format or being too particular about the file paths we allow.

In a trace from the issues we're seeing in #6067, time for localization and report generation goes from ~3500ms to ~33ms.

Even time for localization in the much smaller artifacts in yarn update:sample-json goes from 150ms to 22ms :)

@paulirish
Copy link
Member

NICEEEEEEE 🏁

@paulirish paulirish merged commit 1bedce7 into master Sep 20, 2018
@paulirish paulirish deleted the i18nregex branch September 20, 2018 00:55
@patrickhulce
Copy link
Collaborator

nice easy win 🎉

@ghost
Copy link

ghost commented Sep 20, 2018

เป็นยังไง

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