-
Notifications
You must be signed in to change notification settings - Fork 35.4k
Closed
Labels
editor-inputEditor text inputEditor text inputperfplan-itemVS Code - planned item for upcomingVS Code - planned item for upcoming
Milestone
Description
I recently did an exploration into input latency and found it can get pretty bad on slower machines. A lot of the problem is related to how we use synchronous event emitters/listeners work, performing their work after keypress but before the animation frame.
My proposal to improve is:
- Review the most time consuming event listeners. If they are clearly safe to be performed at a later time without worrying about race conditions being introduced., move them to use an asynchronous event listener to be performed after the animation frame. For example UI updates like activity bar badge and tab indicator when an editor becomes dirty
- Review all events and their listeners, defer as much as possible to after the animation frame. One way of doing this is for each important event to have both a sync and an async event. It's unclear how much we can move exactly, but when we do this we need to be extremely careful to not introduce text buffer-related race conditions as there are some assumptions made that we may be breaking by doing this
- Setup development tools and/or telemetry to easily track measuring latency, I created https://github.com/microsoft/vscode/tree/tyriar/measure_latency to demonstrate a technique to approximate input latency
- Come up with a plan for how we can prevent regressions for this critical path code
Tentatively assigning to October
munael, ivan, Gabriel-Alves-Cunha, Jule-, tomkr4l and 24 moreArniDagur, Balfa, max-sixty, MBirn, Fraetor and 2 moreigorskyflyer and AA-Hamza
Metadata
Metadata
Assignees
Labels
editor-inputEditor text inputEditor text inputperfplan-itemVS Code - planned item for upcomingVS Code - planned item for upcoming