Closed
Bug 584287
Opened 14 years ago
Closed 14 years ago
Make getting id/class/etc faster
Categories
(Core :: DOM: Core & HTML, defect, P1)
Tracking
()
RESOLVED
FIXED
mozilla2.0b4
Tracking | Status | |
---|---|---|
blocking2.0 | --- | beta4+ |
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
1.67 KB,
patch
|
peterv
:
review+
benjamin
:
approval2.0+
|
Details | Diff | Splinter Review |
A bit of thisType magic on nsIDOMHTMLElement goes a long way. The element.property subtest of dromaeo's dom-attr test (which just tests getting .id on an HTML element) gets about 30% faster with this patch.
Assignee | ||
Comment 1•14 years ago
|
||
Attachment #462686 -
Flags: review?(peterv)
Assignee | ||
Updated•14 years ago
|
Attachment #462686 -
Flags: approval2.0?
Assignee | ||
Updated•14 years ago
|
Priority: -- → P1
Assignee | ||
Updated•14 years ago
|
Summary: Make getting id/class/etc faster → [FIX]Make getting id/class/etc faster
Comment 2•14 years ago
|
||
Comment on attachment 462686 [details] [diff] [review]
Like so
This works because all of the HTML elements just forward these getters/setters to nsGenericHTMLElement. Unfortunately I don't think there's an easy way to enforce that.
Attachment #462686 -
Flags: review?(peterv) → review+
Assignee | ||
Comment 3•14 years ago
|
||
Well, the only reason they need to forward is that nsGenericHTMLElement itself isn't what implements nsIDOMHTMLElement. That seems like a bug in itself... ;)
Assignee | ||
Updated•14 years ago
|
Summary: [FIX]Make getting id/class/etc faster → Make getting id/class/etc faster
Whiteboard: [need approval]
Updated•14 years ago
|
Attachment #462686 -
Flags: approval2.0? → approval2.0+
Updated•14 years ago
|
blocking2.0: --- → beta4+
Assignee | ||
Updated•14 years ago
|
Whiteboard: [need approval] → [need landing]
Assignee | ||
Comment 4•14 years ago
|
||
Pushed http://hg.mozilla.org/mozilla-central/rev/6e97f59bcb1c which broke because apparently on Windows quickstubs includes windows.h, which redefines GetClassName to GetClassNameA. And since we were now calling a non-virtual method, linking failed.
khuey pushed http://hg.mozilla.org/mozilla-central/rev/373d1b393f28 to fix that.
Status: NEW → RESOLVED
Closed: 14 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b4
Assignee | ||
Updated•14 years ago
|
Whiteboard: [need landing]
Assignee | ||
Comment 5•14 years ago
|
||
Some combination of this and bug 584293 gave us a 5% win on Dromaeo (DOM) on tinderbox on Linux and Mac.
Comment 6•14 years ago
|
||
(In reply to comment #3)
> Well, the only reason they need to forward is that nsGenericHTMLElement itself
> isn't what implements nsIDOMHTMLElement.
That's because most HTML elements implement interfaces that inherit from nsIDOMHTMLElement, so implementing nsIDOMHTMLElement in nsGenericHTMLElement wouldn't help much.
Assignee | ||
Comment 7•14 years ago
|
||
I think we should think long and hard about whether it makes sense for our C++ class inheritance hierarchy (including for the interface classes) to match the interface inheritance hierarchy defined in the idl... But that's totally out of scope for this bug.
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•