On Chrome something is seriously wrong with the performance of element.addEventListener("touchstart")
in my system, in some cases reaching 100ms for a single call.
r00122 listen touchstart: 60.000ms
r00123 listen touchstart: 61.000ms
r00124 listen touchstart: 61.000ms
The above is the console.time
output of a pure addEventListener
call.
Identical calls for other events take 0ms.
The interesting thing is that every call or two the time taken goes up by another ms.
There is no difference when I turn on or off "Emulate touch events".
However, a simple test case on Chrome runs at 0.01ms/call, so there must be some other dependency. I can't think what it is, other than that fact that I have a large number of elements on the page and am setting up many event listeners (1000). But still, in my page on Mozilla and Safari the call is instantaneous. What on earth could be accounting for this?