Closed
Bug 1585224
Opened 5 years ago
Closed 5 years ago
Cache calUtils get*Service calls to reduce XPCOM overhead
Categories
(Calendar :: General, enhancement)
Calendar
General
Tracking
(Not tracked)
RESOLVED
FIXED
Thunderbird 71.0
People
(Reporter: darktrojan, Assigned: darktrojan)
References
Details
(Keywords: perf)
Attachments
(1 file)
4.05 KB,
patch
|
Fallen
:
review+
|
Details | Diff | Splinter Review |
Every time we ask calUtils for a service, it goes to XPCOM and asks to getService()
. This is expensive, and we do it a lot. Since services are singletons that don't change, we should only do it once and remember the result.
Assignee | ||
Comment 1•5 years ago
|
||
Attachment #9097555 -
Flags: review?(philipp)
Comment 2•5 years ago
|
||
This is expensive, and we do it a lot.
In what places/actions do you expect users to notice/see improvement - startup for example?
Summary: Cache calUtils get*Service calls → Cache calUtils get*Service calls to reduce XPCOM overhead
Comment 3•5 years ago
|
||
Comment on attachment 9097555 [details] [diff] [review]
1585224-cache-getservice-1.diff
Review of attachment 9097555 [details] [diff] [review]:
-----------------------------------------------------------------
::: calendar/base/modules/calUtils.jsm
@@ +20,5 @@
>
> +// Cache services to avoid calling getService over and over again. The cache is
> +// a separate object to avoid polluting `cal`, and is defined here since a call
> +// to `_service` will require it to already exist.
> +var ServiceCache = {};
gServiceCache
Attachment #9097555 -
Flags: review?(philipp) → review+
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/b3b5a9cd7a32
Cache calUtils getService calls; r=Fallen
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•5 years ago
|
Target Milestone: --- → 71
You need to log in
before you can comment on or make changes to this bug.
Description
•