uucore: add regression test for #11247 (eager en-US.ftl parse)#12161
Open
naoNao89 wants to merge 2 commits intouutils:mainfrom
Open
uucore: add regression test for #11247 (eager en-US.ftl parse)#12161naoNao89 wants to merge 2 commits intouutils:mainfrom
naoNao89 wants to merge 2 commits intouutils:mainfrom
Conversation
Adds a failing test asserting that en-US.ftl is not parsed when the primary (non-English) locale loads successfully and no fallback lookup has occurred. Currently fails (parses 1x); will pass once the English fallback bundle is built lazily.
|
GNU testsuite comparison: |
3f7b717 to
b2d458c
Compare
Contributor
|
Thanks! I'm waiting CodSpeed. |
b2d458c to
8a21470
Compare
When the primary (non-English) locale loads successfully, en-US.ftl is no longer parsed at startup. The English bundle is now constructed on demand the first time a message lookup misses the primary bundle, saving startup time and memory for non-English users. - Add `Localizer::with_lazy_fallback(builder)` alongside the existing eager `with_fallback`, with interior mutability to materialize the fallback at lookup time. - Use the lazy path in `init_localization`, the WASI branch of `setup_localization`, and the test helper `init_test_localization`. - The previously failing regression test `test_english_not_parsed_when_primary_locale_loads` now passes.
8a21470 to
0478329
Compare
Contributor
|
No change since our benches are mostly working with english... |
Contributor
|
What happens if the string isn't available in French or other locales? I guess it will return the code and not fallback to English. AFAIK, it is the current behavior |
Contributor
Author
|
right, this PR can't show a speed change on CodSpeed because CodSpeed runs under the win only shows up when |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #11247
init_localization eagerly parses
en-US.ftlon every startup, even when the system locale (e.g.fr-FR) loads successfully and no English fallback lookup ever occurs. This wastes startup time and memory for non-English users