Closed Bug 68885 Opened 24 years ago Closed 24 years ago

nsXBLService::StripWhitespaceNodes() is expensive

Categories

(Core :: XBL, defect)

defect
Not set
normal

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.
Keywords: perf
I have no idea why I made this notification noisy. Making it non-noisy works just fine.
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9
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.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → INVALID
Marking INVALID. Reopen if you have reproducible evidence that the front end code is being called. My tests show it is not.
invalids, wontfixes, dups, worksformes
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.