Closed
Bug 599955
Opened 14 years ago
Closed 14 years ago
Optimize DocumentEncoder
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: smaug, Assigned: smaug)
References
(Blocks 1 open bug)
Details
Attachments
(4 files)
1.50 KB,
text/html
|
Details | |
5.02 KB,
patch
|
Details | Diff | Splinter Review | |
4.37 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
4.36 KB,
patch
|
jst
:
approval2.0+
|
Details | Diff | Splinter Review |
There are still several small things to optimize in DocumentEncoder.
The testcase is a kind of worst-case for gecko.
It shows problems in the DocumentEncoder recursion, SerializeNodeStart and
attribute entity conversion (which happens in serializer, and which this bug
is not about).
Assignee | ||
Comment 1•14 years ago
|
||
Something like this should help a bit.
Comment 2•14 years ago
|
||
You probably could replace some static_casts with AsElement in the code you're moving.
Assignee | ||
Comment 3•14 years ago
|
||
Assignee | ||
Updated•14 years ago
|
Attachment #478874 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 4•14 years ago
|
||
So the patch adds a special case for the cases like innerHTML,
when it is enough to serialize contents of a node in a fast way.
Comment 5•14 years ago
|
||
Comment on attachment 478874 [details] [diff] [review]
a bit simpler patch
>+++ b/content/base/src/nsDocumentEncoder.cpp
>@@ -359,29 +362,29 @@ nsDocumentEncoder::SerializeNodeStart(ns
>+ if (node->IsElement()) {
>+ nsIContent* originalElement =
Make that an Element*?
>+ aOriginalNode && aOriginalNode->IsElement() ?
>+ aOriginalNode->AsElement() : nsnull;
Maybe I should have added a static AsElement() instead, that cast null to null. :(
>+ mSerializer->AppendElementStart(static_cast<nsIContent*>(node),
>+ originalElement, aStr);
And here you can pass node->AsElement() for the first arg, and then it will all Just Work when we change AppendElementStart to take Element. ;)
With those nits, r=me. This looks great!
Attachment #478874 -
Flags: review?(bzbarsky) → review+
Updated•14 years ago
|
Assignee | ||
Comment 6•14 years ago
|
||
This is part of getinnerhtml optimizations and would be great to get this
to ff4.
Attachment #482536 -
Flags: approval2.0?
Updated•14 years ago
|
Attachment #482536 -
Flags: approval2.0? → approval2.0+
Assignee | ||
Comment 7•14 years ago
|
||
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•