Closed
Bug 68885
Opened 24 years ago
Closed 24 years ago
nsXBLService::StripWhitespaceNodes() is expensive
Categories
(Core :: XBL, defect)
Core
XBL
Tracking
()
VERIFIED
INVALID
mozilla0.9
People
(Reporter: rbs, Assigned: hyatt)
Details
(Keywords: perf)
In order to avoid ignorable whitespace, XBL uses StripWhitespaceNodes() to walk
the content model, removing each content which is only whitespace:
aElement->RemoveChildAt(i, PR_TRUE);
This is a very expensive operation because for each call, observers
of the document are notified, among which is the famous frame construction
code, which grovels through the equally famous GetPrimaryFrameFor() ...
I can see this by putting a beak point before the call, and then entering
in that call.
Since whitespace nodes are usually before and after a tag, \n<tag>...</tag>\n,
the overall cost of these removals can be huge. Maybe a leaner solution
is possible -- such as not notifying?
There is a related discussion on ignorable whitespace going on in bug 68411.
| Assignee | ||
Comment 1•24 years ago
|
||
I have no idea why I made this notification noisy. Making it non-noisy works
just fine.
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9
| Assignee | ||
Comment 2•24 years ago
|
||
XBL docs are loaded without a presshell, which means the front end code is not
notified, so whether or not this notification is noisy or not is irrelevant.
| Assignee | ||
Updated•24 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → INVALID
| Assignee | ||
Comment 3•24 years ago
|
||
Marking INVALID. Reopen if you have reproducible evidence that the front end
code is being called. My tests show it is not.
You need to log in
before you can comment on or make changes to this bug.
Description
•