Skip to content

Low FPS on iOS, framerate dips extra when many touch events are triggered #4204

@PWhiddy

Description

@PWhiddy

Description

Hi!

Winit is an awesome project, I've had a great experience using it so far. Platform support has been solid but iOS has been confusing.

Note that my usage is currently on 0.30.9 and I haven't tested the unreleased changes, so if the following has already been addressed please feel free to close this!

I was able to get my project working on iOS by using the trick of calling request_redraw inside of about_to_wait instead of at the end of the RedrawRequested event. I then noticed however that something seems to be adding a lot of overhead and making the app quite slow. Particularly when many touch events are being triggered (for example when dragging a finger across the screen), the continual firing of touch events can drop my framerate to as low as 50% compared to baseline. I am not doing any expensive processing in my touch event handling.

As a sanity check I've also tested my project with the method in wgpu-in-app, and confirmed that I can get almost 2x the framerate without any dips during constant touch event handling.

I'd really appreciate any insight on what could be causing it, and if there's any way to improve / work around this.

Thanks!

Device and iOS version

iPhone 12, iOS 18.3.2

Winit version

0.30.9

Metadata

Metadata

Assignees

No one assigned

    Labels

    B - bugDang, that shouldn't have happenedDS - uikitAffects the UIKit backend (iOS, tvOS, watchOS, visionOS)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions