Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debounce input events in the preset list. #8288

Merged
merged 1 commit into from
Sep 15, 2021

Conversation

jleedev
Copy link
Contributor

@jleedev jleedev commented Jan 9, 2021

On a slow machine, the preset list is painfully slow to search, as it
rerenders the list on every keystroke, which takes several hundred
milliseconds. By debouncing this, it is able to keep up.

Performance analysis:

Before: Typing the word 'stream' results in a 2.5s frame according to
Chrome's profiler. Each input event takes between 300 and 600 ms to run.

After: Typing the word 'stream' results in three 300ms frames. The first
and last input events take around 200ms, while the four in the middle
are ignored by the debouncer.

@bhousel
Copy link
Member

bhousel commented Jan 9, 2021

Actually can we hold off on this change?
I have a nsi-v5 branch, work in progress on integrating the latest name-suggestion-index where I've sped up the preset_list considerably. (it was recalculating the selected entity's extent on every keystroke).

@jleedev
Copy link
Contributor Author

jleedev commented Jan 9, 2021

Checked out that branch and profiled: Typing 'stream' produces a 1500ms frame. The drawList call is taking 200ms in its own right. I believe there's still value in making the search async.

@bhousel
Copy link
Member

bhousel commented Jan 9, 2021

The drawList call is taking 200ms in its own right. I believe there's still value in making the search async.

Yes I agree! Sorry, I should have phrased it more like - there is probably value in this change, I just don't want it to conflict what else I'm working on.

@jleedev jleedev changed the base branch from develop to nsi-v5 January 9, 2021 18:49
@jleedev jleedev force-pushed the preset-debounce branch 2 times, most recently from bd33fcc to 07de50a Compare January 9, 2021 18:51
@kymckay kymckay added performance Optimizing for speed and efficiency enhancement An enhancement to make an existing feature even better labels Jan 14, 2021
@jleedev jleedev force-pushed the preset-debounce branch from 07de50a to f763856 Compare July 6, 2021 11:05
@jleedev jleedev changed the base branch from nsi-v5 to develop July 6, 2021 11:09
@jleedev jleedev force-pushed the preset-debounce branch from f763856 to 4679564 Compare July 6, 2021 11:10
On a slow machine, the preset list is painfully slow to search, as it
rerenders the list on every keystroke, which takes several hundred
milliseconds. By debouncing this, it is able to keep up.

Performance analysis:

Before: Typing the word 'stream' results in a 2.5s frame according to
Chrome's profiler. Each input event takes between 300 and 600 ms to run.

After: Typing the word 'stream' results in three 300ms frames. The first
and last input events take around 200ms, while the four in the middle
are ignored by the debouncer.
@jleedev jleedev force-pushed the preset-debounce branch from 4679564 to effc8fe Compare July 6, 2021 11:12
@mbrzakovic mbrzakovic self-requested a review September 14, 2021 13:34
@mbrzakovic mbrzakovic added this to the 2.20.2 milestone Sep 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement to make an existing feature even better performance Optimizing for speed and efficiency
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants