Closed
Bug 1375287
Opened 7 years ago
Closed 7 years ago
TimeoutManager::SetTimeout should cache all preferences it needs
Categories
(Core :: DOM: Core & HTML, enhancement, P3)
Core
DOM: Core & HTML
Tracking
()
Tracking | Status | |
---|---|---|
firefox56 | --- | fixed |
People
(Reporter: MatsPalmgren_bugz, Assigned: bkelly)
Details
(Keywords: perf)
Attachments
(1 file)
2.94 KB,
patch
|
ehsan.akhgari
:
review+
|
Details | Diff | Splinter Review |
I'm looking at perf log where TimeoutManager::SetTimeout leads to a lot of
hashtable lookups taking time, via a mozilla::Preferences::GetInt call.
I think it's this one (because it's the only one I can find in SetTimeout):
http://searchfox.org/mozilla-central/rev/ae94cfb36d804727dfb38f2750bfcaab4621df6e/dom/base/TimeoutManager.cpp#455
We should use Preferences::Add...VarCache there.
Assignee | ||
Comment 1•7 years ago
|
||
I'll look tomorrow. We already use cached prefs in this file, so it should be an easy fix.
Flags: needinfo?(bkelly)
Assignee | ||
Comment 2•7 years ago
|
||
Assignee: nobody → bkelly
Status: NEW → ASSIGNED
Flags: needinfo?(bkelly)
Assignee | ||
Comment 3•7 years ago
|
||
Comment on attachment 8880404 [details] [diff] [review]
Make TimeoutManager use a pref cache variable for dom.disable_open_click_delay. r=ehsan
Avoid pref lookups in setTimeout() by using a cached var. Pretty straightforward.
Attachment #8880404 -
Flags: review?(ehsan)
Updated•7 years ago
|
Whiteboard: [qf] → [qf:p3]
Comment 4•7 years ago
|
||
Comment on attachment 8880404 [details] [diff] [review]
Make TimeoutManager use a pref cache variable for dom.disable_open_click_delay. r=ehsan
Review of attachment 8880404 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/base/TimeoutManager.cpp
@@ +342,5 @@
> DEFAULT_MAX_CONSECUTIVE_CALLBACKS_MILLISECONDS);
> +
> + Preferences::AddIntVarCache(&gDisableOpenClickDelay,
> + "dom.disable_open_click_delay",
> + 0);
Since you defined DEFAULT_DISABLE_OPEN_CLICK_DELAY I expect you meant to use it here instead of hardcoding 0.
Attachment #8880404 -
Flags: review?(ehsan) → review+
Pushed by bkelly@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/c39e7022a80c
Make TimeoutManager use a pref cache variable for dom.disable_open_click_delay. r=ehsan
Comment 6•7 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox56:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
Updated•3 years ago
|
Performance Impact: --- → P3
Whiteboard: [qf:p3]
You need to log in
before you can comment on or make changes to this bug.
Description
•