-
-
Notifications
You must be signed in to change notification settings - Fork 91
avoid allocating hats to the first letter of a token #1723
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
avoid allocating hats to the first letter of a token #1723
Conversation
I plan to keep running this for a little while longer, gathering data, but I thought I would share it in case anyone else wants to play with it. (I know the tests are busted.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good with minor tweak
packages/cursorless-engine/src/tokenGraphemeSplitter/tokenGraphemeSplitter.ts
Outdated
Show resolved
Hide resolved
I propose that we declare that it fixes cursorless-dev#1658, at least for now.
0385b48
to
da3c7f1
Compare
here's another rev. lots of tests are still failing; it's going to be tedious to fix them, so I'd like to wait until we are relatively confident in the rest of the direction. |
...rless-engine/src/processTargets/modifiers/scopeHandlers/WordScopeHandler/WordScopeHandler.ts
Show resolved
Hide resolved
notes to self:
|
update: @AndreasArvidsson is going to have a look and take this one home if it's pretty close to mergeable in its current form |
great, thanks! |
@josharian Have you evaluated the difference between just avoiding the first character in the token verses the first character in every subword? When I first thought about this problem I kinda just envisioned the first character in the token, but your implementation is doing every subword which could be better. Any insight? |
I remember thinking at the time that doing sub words was important. But It is not something I ever gathered data about, because the effects are purely qualitative. And a lot of time has now gone by… |
I just did some performance tests. Using a single editor with typescript the hat allocation went from about 6ms to 8ms. Percentage wise quite a lot, but two milliseconds we can live with. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@josharian Thank you for your immense patience. I have finally had time to properly evaluate this. Great work!
We could get much fancier than this,
but after running this with a day it appears to help some,
and it is nice and simple.
I propose that we declare that it fixes #1658,
at least for now.
Checklist