Cache URelativeDateTimeFormatter for Intl.RelativeTimeFormatObject instances

RESOLVED FIXED in Firefox 60

Status

()

P3
normal
RESOLVED FIXED
a year ago
a year ago

People

(Reporter: anba, Assigned: anba)

Tracking

Trunk
mozilla60
Points:
---

Firefox Tracking Flags

(firefox60 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

a year ago
Caching URelativeDateTimeFormatter avoids creating new ones for every call to Intl.RelativeTimeFormatObject.prototype.format().
(Assignee)

Comment 1

a year ago
Adds caching for URelativeDateTimeFormatter to Intl.RelativeTimeFormat.

I've also changed |intl_FormatRelativeTime()| to pass the Intl.RelativeTimeFormat's type from JS->C++, because that avoids a slow-ish C++->JS call when calling |GetInternalsObject()|. And I've changed some lines so they don't exceed the 99 chars per line limit.
Attachment #8947924 - Flags: review?(gandalf)
Comment on attachment 8947924 [details] [diff] [review]
bug1435325.patch

lgtm!
Attachment #8947924 - Flags: review?(gandalf) → review+

Comment 4

a year ago
Pushed by nbeleuzu@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/af6cc52c9b8b
Cache URelativeDateTimeFormatter in Intl.RelativeTimeFormat. r=gandalf
Keywords: checkin-needed

Comment 5

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/af6cc52c9b8b
Status: ASSIGNED → RESOLVED
Last Resolved: a year ago
status-firefox60: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
You need to log in before you can comment on or make changes to this bug.