Skip to content

Flutter adds additional one frame touch latency compared to native #110431

@knopp

Description

@knopp
Bad Expected
tracking-bad.mov
tracking-expected.mov

Repository: https://github.com/knopp/flutter_scroll_overlay

When touch event is received, instead of immediately beginning a frame Flutter waits for next vsync. But that skips an entire frame. By the time vsync comes, the frame should be already rendered and ready to go. But instead it has just began. On iOS touch events seem to be delivered within few milliseconds of the display link callback so there should be enough time.

You can pause the "bad" video to see that during scrolling Flutter lags behind native by one frame exactly.

The expected video is with quick and dirty engine modification that forces BeginFrame immediately on input event.

The way vsync is implemented in Flutter might need some work. It should make sure that repaints are synchronized with display updates, but it shouldn't be causing additional latency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: fidelityMatching the OEM platforms betterengineflutter/engine related. See also e: labels.platform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions