Closed Bug 1502529 Opened 6 years ago Closed 5 years ago

Coalesce touchmove

Categories

(Core :: DOM: UI Events & Focus Handling, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla76
Performance Impact medium
Tracking Status
firefox76 --- fixed

People

(Reporter: smaug, Assigned: smaug)

References

(Blocks 2 open bugs)

Details

(Keywords: perf:responsiveness)

Attachments

(1 file)

I think we should try to coalesce touchmoves similarly to mousemoves. Chrome is doing that. http://mozilla.pettay.fi/moztests/touchmove.html The last line shows average touchmoves per animation frame. Try using two fingers. Something to consider here is how to handle https://w3c.github.io/pointerevents/extension.html#extensions-to-the-pointerevent-interface
Priority: -- → P2
Whiteboard: [qf]
Whiteboard: [qf] → [qf:p2:responsiveness]

Looks like on Windows things are a bit different. http://mozilla.pettay.fi/moztests/pointermove.html should work on Edge too.
We don't seem to dispatch so many events.

(but coalescing is needed on mobile at least.)

Reproduced on Lenovo Yoga C630-13Q50 with Windows 10 Home (v1803) on latest Nightly aarch64 build.

Component: Event Handling → User events and focus handling
Blocks: 1612365

It seems like we would also need to implement getCoalescedEvents for touch events. At the moment this seems to be implemented only for pointer events from mouse move events. Do we send pointer events for touch events on Android?
Furthermore, Android has its own touch move event batching, but lets you access the "historical" events of a MotionEvent.

Yes, pointer events are supported on multiprocess GeckoView.
(Fennec doesn't have pointere events)

Blocks: 1602798

One simple way to get at least the IPC level compression would be to add a new IPC message
RealTouchMoveEvent2 or some such. It would behave exactly like RealTouchMoveEvent.
Whenever sender changes the touch stream id of the touches it is sending, it would switch to the other RealTouchMoveEvent* message.
Then both the the messages could use compress in ipdl.

(That wouldn't affect to getCoalescedEvents, but that is a bit separate issue anyhow)

A variant of the original testcase showing that if JS listeners are slow, we end up queuing more touchmoves
http://mozilla.pettay.fi/moztests/touchmoveslow.html
http://mozilla.pettay.fi/moztests/touchmove2slow.html

Attachment #9127408 - Attachment description: Bug 1502529, compress touchmoves on IPC layer (single touches only atm) → Bug 1502529, compress touchmoves on IPC layer
Assignee: nobody → bugs
Attachment #9127408 - Attachment description: Bug 1502529, compress touchmoves on IPC layer → Bug 1502529, compress touchmoves on IPC layer, r=masayuki
Status: NEW → ASSIGNED
Pushed by opettay@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/139fa21432f0 compress touchmoves on IPC layer, r=masayuki
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla76
Blocks: 1315250
Performance Impact: --- → P2
Whiteboard: [qf:p2:responsiveness]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: