Closed
Bug 558148
Opened 16 years ago
Closed 16 years ago
Optimize nsContentUtils::HasMutationListeners
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: smaug, Assigned: smaug)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
|
11.97 KB,
patch
|
sicking
:
review-
|
Details | Diff | Splinter Review |
|
5.86 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
This is called a lot, so better to make it as fast as possible.
We can remove some virtual calls, and maybe inline the most commonly run
code paths.
| Assignee | ||
Comment 1•16 years ago
|
||
| Assignee | ||
Comment 2•16 years ago
|
||
The patch is something very-quickly-written.
But with it the Dromaeo DOM attribute tests goes
from 147-150 to 155-156 here.
And HasMutationListeners did show up surprisingly much in the profile before
inlining the relevant parts (inlining does of course increase the time
spent in the caller).
In any case, at least the GetInnerWindow() optimization should be done,
and I think I want to do something similar for GetWindow().
The patch should affect especially to the SetAttr call.
I pushed the patch to tryserver.
Comment 3•16 years ago
|
||
> from 147-150 to 155-156 here.
Just the setAttribute test, or the whole set of 6? setAttribute seems to easily be 5% or so under HasMutationListeners over here, so I'd believe that.
| Assignee | ||
Comment 4•16 years ago
|
||
The "DOM Attributes" test, whatever all it includes.
| Assignee | ||
Comment 5•16 years ago
|
||
Comment on attachment 437932 [details] [diff] [review]
a patch
On 64bit linux I don't see as big change in attribute test, but still some, and this affects also to other DOM tests.
We don't have awful lots of nsContentUtils::HasMutationListeners calls in the tree, so hopefully the code size change isn't too bad.
In nsIDocument I put the *Internal to the end of the class, since nsIDocument is semi-public interface.
In nsContentUtils it is just easier to keep *Internal() close to the
non-*Internal().
Attachment #437932 -
Flags: review?(bzbarsky)
Comment 6•16 years ago
|
||
> The "DOM Attributes" test, whatever all it includes.
Ah, interesting. That has 6 tests, 4 of which actually touch the DOM (getAttribute/setAttribute and .id get/set). I guess your speedup was a tad less than 5%, which makes sense.
| Assignee | ||
Updated•16 years ago
|
Attachment #437932 -
Flags: review?(bzbarsky) → review?(jonas)
Comment on attachment 437932 [details] [diff] [review]
a patch
I'd be surprised if the inlining of HasMutationListeners actually helps. I think I'd prefer to do that if that in and of itself shows up as a benefit.
so r-=me on that part for now.
I do like the nsIDocument changes though. That's a good idea. r+=me on that part.
Could we also remove the "IsOuterWindow()" and "!mOuterWindow" checks from nsPIDOMWindow::HasMutationListeners?
Attachment #437932 -
Flags: review?(jonas) → review-
| Assignee | ||
Comment 8•16 years ago
|
||
I'll test/profile the inlining part tomorrow.
| Assignee | ||
Comment 9•16 years ago
|
||
Attachment #439390 -
Flags: review+
| Assignee | ||
Comment 10•16 years ago
|
||
OK, inlining HasMutationListeners doesn't seem to help too much.
I'll push the nsIDocument change tomorrow and ask review for the
HasMutationListeners inlining if I find out it useful enough.
| Assignee | ||
Comment 11•16 years ago
|
||
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Updated•7 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•