Repository navigation
Reuse the desktop gram formatter across weight labels - #293
Merged
Merged
Conversation
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.
Reuse the default desktop gram formatter across consecutive labels in the same display language. The cache holds one formatter. Custom precision and sign options use the existing per-call path. Roll and product weights continue to use the shared locale registry and the same unit and rounding rules.
Regression coverage compares repeated labels with native Intl output across the locale registry, including a return to English, localization aliases, default language and interleaved signed two-decimal labels.
Measurements
Production Chromium UI and release Rust with synthetic SQLite libraries, locally and on an authenticated paired loopback Client. The 10,000-roll library has 1,000 products with ten rolls each. Starting on a loaded card view, the probe opens list view, searches for a supplier matching 5,000 rolls, clears the search, then returns to cards. For the empty library it measures opening the list. Times run from click or text input through the animation frame after the expected result count and rows appear and all pending desktop calls settle. Medians of seven measured runs after two warm-ups, alternating versions. Byte counts include serialized requests and responses excluding headers and assets.
A separate instrumented Chromium run counted 1184 → 0 new gram formatters when returning to cards on the paired 10,000-roll library, after the active locale had already been used. Timings above come from the uninstrumented runs. Opening the full local list measured 8 ms slower in this sample.