Closed Bug 1435325 Opened 3 years ago Closed 3 years ago
Date Time Formatter for Intl .Relative Time Format Object instances
Caching URelativeDateTimeFormatter avoids creating new ones for every call to Intl.RelativeTimeFormatObject.prototype.format().
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+
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/mozilla-inbound/rev/af6cc52c9b8b Cache URelativeDateTimeFormatter in Intl.RelativeTimeFormat. r=gandalf
You need to log in before you can comment on or make changes to this bug.