Closed
Bug 509889
Opened 15 years ago
Closed 15 years ago
nsEventStateManager::GetContentState needs fast path to nsFocusManager::GetFocusedElement
Categories
(Core :: DOM: UI Events & Focus Handling, defect, P3)
Core
DOM: UI Events & Focus Handling
Tracking
()
RESOLVED
FIXED
mozilla1.9.3a1
Tracking | Status | |
---|---|---|
status1.9.2 | --- | beta1-fixed |
People
(Reporter: dbaron, Assigned: dbaron)
Details
(Keywords: perf)
Attachments
(1 file)
3.77 KB,
patch
|
enndeakin
:
review+
benjamin
:
approval1.9.2+
|
Details | Diff | Splinter Review |
I just did a profile of new-browser-window performance in Firefox, and noticed that we're spending ~1% of the time (in whatever callgrind measures it in, which isn't real time, but it's something) doing nsEventStateManager::GetContentState's call to nsFocusManager::GetFocusedElement, which involves doing a QueryInterface from nsIContent to nsIDOMElement, returning the object, and then QIing the other way, and the ensuing reference counting and nsCOMPtr machinery. (GetContentState is called a huge number of times because we call it during selector matching... and up-front on the assumption that it will be cheap.) nsFocusManager ought to have a de-COM-taminated getter that returns a raw nsIContent pointer (not AddRef-ed). Neil, do you have a preference between: (1) putting a second GetFocusedElement method on nsFocusManager and make nsFocusManager::GetFocusManager return an nsFocusManager instead of nsIFocusManager, or (2) adding a static nsFocusManager::GetFocusedElement method that specifically called an nsFocusManager method on sInstance (and only change the type of sInstance and not GetFocusManager)?
Comment 1•15 years ago
|
||
Number 1 sounds better.
Assignee | ||
Comment 2•15 years ago
|
||
Updated•15 years ago
|
Attachment #394187 -
Flags: review?(enndeakin) → review+
Assignee | ||
Comment 3•15 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/f555ee21c59a
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Priority: -- → P3
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3
Assignee | ||
Comment 4•15 years ago
|
||
Comment on attachment 394187 [details] [diff] [review] patch Very simple de-COM-tamination performance win, fixing a regression from the focus manager landing.
Attachment #394187 -
Flags: approval1.9.2?
Assignee | ||
Comment 5•15 years ago
|
||
catlee's performance monitoring scripts reported around a 1% Tdhtml win when this landed, but didn't report any Txul changes. I landed it with some other large patches, though, but I think it's likely this one: http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=e0cc032cb852&tochange=e6034ded61fd
Updated•15 years ago
|
Target Milestone: mozilla1.9.3 → mozilla1.9.3a1
Updated•15 years ago
|
Attachment #394187 -
Flags: approval1.9.2? → approval1.9.2+
Assignee | ||
Comment 6•15 years ago
|
||
http://hg.mozilla.org/releases/mozilla-1.9.2/rev/c64779a5e8ca
status1.9.2:
--- → beta1-fixed
Comment 7•15 years ago
|
||
This reduced Tdhtml 1% on 1.9.2 as well (and landed there alone, so gets the credit all to itself).
Updated•5 years ago
|
Component: Event Handling → User events and focus handling
You need to log in
before you can comment on or make changes to this bug.
Description
•