Skip to content

Reuse the desktop gram formatter across weight labels - #293

Merged
bliatun-code merged 1 commit into
mainfrom
codex/reuse-gram-formatter
Nov 26, 2026
Merged

bliatun-code merged 1 commit into
mainfrom
codex/reuse-gram-formatter

Conversation

@bliatun-code

Copy link
Copy Markdown
Owner

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.

Library Spools Action Time in ms (before → after) Desktop bytes Client–Host bytes
Local 0 list 42.9 → 43.6 1,513 —
Local 10,000 list 137.8 → 145.8 9,599,884 —
Local 10,000 search 53.7 → 51.6 0 —
Local 10,000 clear 57.1 → 39.7 0 —
Local 10,000 cards 215.4 → 197.6 0 —
Paired 0 list 80.0 → 76.0 1,447 4,686
Paired 10,000 list 196.9 → 195.7 8,726,446 9,602,441
Paired 10,000 search 52.2 → 51.8 0 0
Paired 10,000 clear 55.9 → 39.0 0 0
Paired 10,000 cards 212.7 → 197.2 0 0

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.

@bliatun-code
bliatun-code merged commit e647cc0 into main Nov 26, 2026
10 checks passed
@bliatun-code
bliatun-code deleted the codex/reuse-gram-formatter branch November 26, 2026 14:12
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.

1 participant