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

Optimize the keystroke code path #911

merged 18 commits into from Nov 11, 2017


None yet
1 participant

leroix commented Oct 28, 2017

In this PR, I

  • applied caching to hot code paths and eliminated allocations and closures where possible
  • reduced the number of matches returned per buffer from 100 to 20 in the subsequence provider
  • removed the 50ms delay for displaying suggestions (interferes with the next keystroke)
  • dealt with situations where we were rendering outside of an animation frame
  • added a characterMatchIndices field to suggestions in in order to remove unnecessary calls to fuzzalrin

I've tried to optimize for two things in this PR:

  1. the time from key character event start to screen paint
  2. the idle time between keystrokes (finishing any scripting, rendering, and painting for ac+ well ahead of the next keystroke)

In the image below, the red lines denote where the key character event starts.

screen shot 2017-10-27 at 7 34 02 pm

I'm not the fastest typer in the west, but my keystrokes can run as low as 40ms apart, and this seems to work smoothly with the changes in this PR.


This comment has been minimized.

Show comment
Hide comment

leroix commented Nov 3, 2017

@leroix leroix merged commit 50f0ffd into master Nov 11, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed

@leroix leroix deleted the optimizations branch Nov 11, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment