Skip to content

Web backend sends RedrawRequested too often #1305

@ryanisaacg

Description

@ryanisaacg

An expected user pattern with the new API is to request redraw after every EventsCleared.

On web, the event handlers are run instantly as events come in, which means there can be many more EventsCleared than the user expects.

I can think of two ways to address this:

  • Don't run the event handlers as often, and buffer up events with a minimum time between processing them. This adds latency where it isn't necessarily needed, so it may not be ideal.
  • Only run RedrawRequested events on a timer determined by the browser requestAnimationFrame API, which does slightly break the API contract.

I'm not sure which of these mitigations is better, so I would welcome discussion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C - needs discussionDirection must be ironed outD - averageLikely as difficult as most tasks hereDS - webAffects the Web backend (WebAssembly/WASM)H - help wantedSomeone please save usP - highVital to have

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions