getSelectedLocale spends time sorting locales unnecessarily
Categories
(Firefox for Android :: General, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox152 | --- | fixed |
People
(Reporter: mstange, Assigned: kaya)
References
(Blocks 2 open bugs)
Details
(Whiteboard: [group6][fenix-applink][fxdroid])
Attachments
(1 file, 1 obsolete file)
Profile: https://share.firefox.dev/48FzHrj
When we call getSelectedLocale during the initialization of the pocket stories service, we spend an unnecessary amount of time building a sorted list of the supported locales, just so that we can check whether the locale returned from getCurrentLocale is one of the supported locales.
I believe we could just check getCurrentLocale's language tag against the language tags in SUPPORTED_LOCALE_ARRAY instead.
The sorting is slow because the displayLanguage and displayCountry accessors don't cache the ICU locale object, so those internal C++ objects get recreated for every comparison performed during the sort.
| Reporter | ||
Comment 1•9 months ago
|
||
Updated•9 months ago
|
Comment 2•9 months ago
|
||
Triage: adding the whiteboard label for tracking.
Adding the label because locale querying affects the pocket config which affects the homepage.
Comment 3•9 months ago
|
||
The Bugbug bot thinks this bug should belong to the 'Firefox for Android::Tooling' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 5•9 months ago
|
||
The severity field is not set for this bug.
:polly, could you have a look please?
For more information, please visit BugBot documentation.
Updated•9 months ago
|
Updated•9 months ago
|
Updated•9 months ago
|
| Assignee | ||
Updated•6 months ago
|
| Assignee | ||
Updated•6 months ago
|
| Assignee | ||
Comment 6•5 months ago
|
||
Comment 8•5 months ago
|
||
| bugherder | ||
Updated•5 months ago
|
Description
•