Ticket #1871 (closed bug: fixed)
fix() in event propagation is slow
|Reported by:||olau||Owned by:|
The fix() function called when an event is propagated deep copies the event to be able to set a few attributes. Unfortunately, the event object is quite large so this is really expensive for events like mousemove. On my 950 MHz PIII wiggling the mouse when an empty callback is set with mousemove() uses up 100% of the CPU time in Firefox.
There's a longer discussion on the mailing list here: http://groups.google.com/group/jquery-dev/browse_thread/thread/cc768c85d5514098
I've tried shallow copying the event with "for (v in originalEvent) event[v] = originalEvent[v];", but it's still slow.
The only solution I can think of is to copy a couple of documented standard values from the event object, normalizing them as needed, and then let people access the browser event object with an originalEvent field. If you can tell me which values to copy, I'd be happy to supply a patch.