stuyam / pressure

:point_down::boom: JavaScript library for handling Force Touch, 3D Touch, and Pointer Pressure.
https://pressurejs.com
MIT License
2.92k stars 97 forks source link

Performance issue for "pointermove" events #96

Open christosnc opened 3 years ago

christosnc commented 3 years ago

Hello 👋,

Some browser events (such as pointermove) can fire faster than the frame-rate of the browser. This causes issues, because the browser cannot keep up. Although some browsers automatically "throttle" such events to run at 60fps, there are some bugs / inconsistencies.

For example, on Chrome, when the Dev-tools are open, the throttling doesn't work. To reproduce, open the Dev-tools on Chrome and click the element attached to Pressure.js and move the mouse a lot. After a while you will see a performance drop, which only gets worse and worse.

Please refer to this article here which describes the problem in detail and proposes a solution.

Please consider this, as it makes the library completely unusable under those conditions.

Thanks!


Macbook Pro 16", macOS Big Sur, Chrome