calDateTimeFormatter.inTimezone could be more efficient
Categories
(Calendar :: Internal Components, defect)
Tracking
(thunderbird_esr78 wontfix)
Tracking | Status | |
---|---|---|
thunderbird_esr78 | --- | wontfix |
People
(Reporter: standard8, Assigned: darktrojan)
References
Details
(Keywords: perf)
Attachments
(1 file, 1 obsolete file)
I'm working on adding a test for the amount of accesses of preferences on startup. I noticed that intl.regional_prefs.use_os_locales
is access about 100 times.
A lot of these accesses (~90) are via calDateTimeFormatter#inTimezone
-> MozDateTimeFormat
-> getLocales
.
The obvious issue is that the formatter might be constructed twice if the date has a timezone, this should be able to be avoided.
The other thing that might be possible is to cache the formatter in the calls to inTimezone
. This might, of course, depend on how frequently the timezone might be different, but would at least give some possibilities for improvement when it is all the same.
Updated•4 years ago
|
Comment 1•4 years ago
|
||
Would you expect this to have only minor performance impact, i.e. not likely to be noticeable by itself, <2sec?
Reporter | ||
Comment 2•4 years ago
|
||
(In reply to Wayne Mery (:wsmwk) from comment #1)
Would you expect this to have only minor performance impact, i.e. not likely to be noticeable by itself, <2sec?
Probably not noticeable by itself, but would definitely be worth doing as part of general startup performance and probably application performance.
Updated•4 years ago
|
Assignee | ||
Comment 3•4 years ago
|
||
Bug 1635561 has dramatically improved the count.
Updated•4 years ago
|
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/bd4299747089
Remove intl.regional_prefs.use_os_locales from the list of problematic start-up prefs. r=Standard8
Assignee | ||
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Comment 5•4 years ago
|
||
Ah, spoke too soon. Bug 1635561 did improve the count, but that's because it didn't work properly. Back to square one here.
Updated•4 years ago
|
Assignee | ||
Comment 6•4 years ago
|
||
backout |
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Comment hidden (Intermittent Failures Robot) |
Assignee | ||
Comment 8•4 years ago
|
||
In testing, this saves thousands of calls to new Services.intl.DateTimeFormat
and hundreds of calls to the preferences service.
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/f6f7743a893b
Prevent redundant calls to new Services.intl.DateTimeFormat and preferences service in hot code paths. r=mkmelin
Description
•