Closed Bug 726340 Opened 12 years ago Closed 12 years ago

Make nsDOMEvent a skippable class

Categories

(Core :: DOM: Events, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: mccr8, Unassigned)

References

Details

With the patch from bug 726331, the purple buffer on TechCrunch is dominated by nsDOMEvent.  At least, from the CC gets triggered when I scroll down the page:
- On graph 3, 431 childless purple nsDOMEvents, out of 649 things in the purple buffer.
- On graph 4, 263 childless purple nsDOMEvents, out of 405 things in the purple buffer.
- On graph 5, 658 childless purple nsDOMEvents, out of 720 things in the purple buffer.

This will be trickier to fix, because nsDOMEvent has a number of fields and a number of subclasses.  Maybe this isn't worth doing.
Interesting. DOMEvents are usually kept alive only by JS.
But I don't know how to check blackness of a DOMEvent. They don't have a wrappercache.
Perhaps nsWrappedNative should be able remove objects from the purple buffer if the JS is black.
We don't need to check if it is alive, we can check if its children are all alive.  Assuming that isn't too expensive.  If all of its children are alive, then we don't need to visit it in the CC.
ah, very true, but tricky.
Blocks: 726442
No longer blocks: 716598
I should log info on what all of these childless events are, and why they have no children.  Maybe it is just something simple.
I would assume most of the events are mouse events (mousemove, mouseover, mouseout) and
event.*target point to some element in a in-CCgeneration document and event.view points to
a in-CCgeneration window object.
Makes sense.  When I madly scroll up and down there are about 1000 childless nsDOMEvents in the purple buffer, but maybe that's not a very useful scenario to optimize for.
I hacked up some code to print out what kind of event it is, just based on the split in the Traverse function.  It seems a roughly even mix of "other" (the default case), mouse and mouse scroll.
Probably not really needed any more given bug 728460.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.