-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Web backend sends RedrawRequested too often #1305
Copy link
Copy link
Closed
Labels
C - needs discussionDirection must be ironed outDirection must be ironed outD - averageLikely as difficult as most tasks hereLikely as difficult as most tasks hereDS - webAffects the Web backend (WebAssembly/WASM)Affects the Web backend (WebAssembly/WASM)H - help wantedSomeone please save usSomeone please save usP - highVital to haveVital to have
Description
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
RedrawRequestedevents on a timer determined by the browserrequestAnimationFrameAPI, which does slightly break the API contract.
I'm not sure which of these mitigations is better, so I would welcome discussion.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C - needs discussionDirection must be ironed outDirection must be ironed outD - averageLikely as difficult as most tasks hereLikely as difficult as most tasks hereDS - webAffects the Web backend (WebAssembly/WASM)Affects the Web backend (WebAssembly/WASM)H - help wantedSomeone please save usSomeone please save usP - highVital to haveVital to have