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

--merge should memoize the results for performance #161

Open
movermeyer opened this issue Jun 16, 2022 · 0 comments
Open

--merge should memoize the results for performance #161

movermeyer opened this issue Jun 16, 2022 · 0 comments

Comments

@movermeyer
Copy link
Collaborator

--merge currently takes a long time, needlessly.

Instead of iterating over each locale in turn and merging in the ancestor locales each time:

en-CA -> en -> root
en-GB -> en -> root
en-US -> en -> root

All of these use the en -> root, which is the same data, so there is no need to recompute those for each child locale.

Instead, you could iterate over the graph of locales breadth-first starting at the root locale, then cache the results for use in the other locales.

(Of course, this might not be worth doing as the whole concept of --merge is likely to change. I just wanted to capture this potential optimization here)

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

No branches or pull requests

1 participant