Ticket #4398 (closed bug: wontfix)
mousemove() event handling is slow
|Reported by:||olau||Owned by:||brandon|
Event handling for mousemove event still causes a significant overhead. If I attach to document.onmousemove with an empty anonymous function and wiggle the mouse on my trusty old 950 MHz PIII, Firefox 3 is using about 22% CPU. With jQuery's mousemove() and the same empty function it's about 45-50%.
Here's a breakdown of the timings from the Firebug profiler with jquery-1.3.2.js:
name calls % owntime time fix() 668 71.78% 2538.725ms 2806.368ms (line 2713) handle() 668 13.84% 489.503ms 3356.589ms (line 2666) Event() 1336 5.73% 202.810ms 267.643ms (line 2800) (?)() 668 5.09% 180.029ms 3536.618ms (line 2465)
fix() still appears to be the culprit. I think a solution might be to special-case mousemove (because we get a lot of those), as far as I can tell most of the stuff jQuery is doing on each and every of those events is completely useless for mousemoves where you typically (?) just want the pageX/pageY.