Performance of touchMove

Hi all!

Does anyone have any experience with touchMove performance (issues).
I am using Chrome DevTools to monitor the performance of my phone (an oldie) running the debug version of the game.

When using the PlayCanvas way of adding and using events regarding touch (as in e.g. this.app.touch.on(pc.EVENT_TOUCHMOVE…) I get a steady 3/4 ms per frame for handling the touchMove event.

When I disable touch input altogether and use eventlisteners (as in document.addEventListener(‘touchmove’,…) i go to a steady 1.5 ms (with an occasional spike back to 3 or 4).

Maybe this is not something to worry about and just keep using the PlayCanvas way, but has anyone ever tackled this - or looked into this. Any other experiences?

I am trying to squeeze out all the performance I can get.

-Pieter

try using touch-action: none; or ms-touch-action: none; on the element. What it actually does is removes the default javascript injected by browser that alters touch positions.

1 Like

Related PR: https://github.com/playcanvas/engine/pull/4279

We had to revert it though as it caused other input issues on touchStart. The current thinking is that we only make the touch move event passive.