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

Improve performance of word motions #3662

Merged
merged 1 commit into from
Apr 8, 2019

Conversation

ajalab
Copy link
Contributor

@ajalab ajalab commented Apr 7, 2019

What this PR does / why we need it

This PR fixes the performance issue reported in #3660. It changes the definition of the following properties in Position:

  • _nonWordCharRegex
  • _nonBigWordCharRegex
  • _nonCamelCaseWordCharRegex
  • _sentenceEndRegex
  • _nonFileNameRegex

so that the construction of these regular expressions is performed only once.
The time to complete the benchmark task proposed in #3660 was 431ms in average, which is 12x faster than the current version on my machine.

Which issue(s) this PR fixes

fixes #3660.

Special notes for your reviewer:

@jpoon
Copy link
Member

jpoon commented Apr 8, 2019

🍾 thanks!

@jpoon jpoon merged commit d852fd5 into VSCodeVim:master Apr 8, 2019
@jpoon jpoon mentioned this pull request Apr 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Performance degradation of word motions in v1.3.0
2 participants