Closed Bug 558773 Opened 14 years ago Closed 14 years ago

Reduce virtual calls during event dispatch

Categories

(Core :: DOM: Events, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: smaug, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Attached patch patchSplinter Review
nsIEventListenerManager::HandleEvent can be moved
to nsEventListenerManager, since the only one who should call it is
nsEventDispatcher/nsEventTargetChainItem.

And by inlining some of the HandleEvent we can speed up the code even more.
The inlining part is basically saying:
"we know we're not going to handle the event, return as early as possible"
Code size shouldn't change much, because there is only one
HandleEvent caller. I could try to inline the whole method, but atm
that doesn't seem practical.

In many cases this all seems to give 4% speed up in event *dispatching*, but
in pathological cases, like http://mozilla.pettay.fi/moztests/events/event_speed_4.html ,
it is closer to 10%.
Attachment #438467 - Flags: review?(jst)
Attachment #438467 - Flags: review?(jst) → review+
http://hg.mozilla.org/mozilla-central/rev/88bea857d0f3
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Depends on: 1114991
No longer depends on: 1114991
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: