Closed
Bug 1435306
Opened 5 years ago
Closed 5 years ago
Cache UPluralRules and UNumberFormat for Intl.PluralRules instances
Categories
(Core :: JavaScript: Internationalization API, enhancement, P3)
Core
JavaScript: Internationalization API
Tracking
()
RESOLVED
FIXED
mozilla60
Tracking | Status | |
---|---|---|
firefox60 | --- | fixed |
People
(Reporter: anba, Assigned: anba)
Details
Attachments
(1 file)
13.44 KB,
patch
|
zbraniecki
:
review+
|
Details | Diff | Splinter Review |
Caching UPluralRules and UNumberFormat avoids creating new ones for every call to Intl.PluralRules.prototype.select.
Assignee | ||
Comment 1•5 years ago
|
||
Adds caching for UPluralRules and UNumberFormat to Intl.PluralRules. I've also modified intl_GetPluralCategories() to compute the available categories from an Intl.PluralRules instance instead of locale and type string arguments. This allows intl_GetPluralCategories() to use the UPluralRules caching, too. Furthermore I've removed to call to intl_GetPluralCategories() in resolvePluralRulesInternals() and instead moved it to Intl_PluralRules_resolvedOptions(). That way we only need to compute the available categories when Intl_PluralRules_resolvedOptions() is actually called.
Attachment #8947911 -
Flags: review?(gandalf)
Comment 2•5 years ago
|
||
Comment on attachment 8947911 [details] [diff] [review] bug1435306.patch Review of attachment 8947911 [details] [diff] [review]: ----------------------------------------------------------------- lgtm! Thanks!
Attachment #8947911 -
Flags: review?(gandalf) → review+
Assignee | ||
Comment 3•5 years ago
|
||
Try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=7a07f087bead65bab769c178c3d7806a1acf3045
Keywords: checkin-needed
Pushed by nbeleuzu@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/a3d21e203519 Cache UPluralRules and UNumberFormat for Intl.PluralRules instances. r=gandalf
Keywords: checkin-needed
Pushed by jandemooij@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/cefac2e7eb0c followup - Fix rooting hazard. r=red CLOSED TREE
Comment 6•5 years ago
|
||
anba, the rooting hazard complained because it thinks uplrules_close can GC. The sheriffs asked about this and I pushed a follow-up fix, restructuring the code a little. Feel free to land a better fix.
Comment 7•5 years ago
|
||
(In reply to Jan de Mooij [:jandem] from comment #6) > the rooting hazard complained Ugh, rooting analysis, of course.
Comment 8•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/a3d21e203519 https://hg.mozilla.org/mozilla-central/rev/cefac2e7eb0c
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
Assignee | ||
Comment 9•5 years ago
|
||
(In reply to Jan de Mooij [:jandem] from comment #6) > anba, the rooting hazard complained because it thinks uplrules_close can GC. > > The sheriffs asked about this and I pushed a follow-up fix, restructuring > the code a little. Feel free to land a better fix. The change looks good to me! Thanks for fixing it.
You need to log in
before you can comment on or make changes to this bug.
Description
•