-
Notifications
You must be signed in to change notification settings - Fork 172
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
Use code units cache API #2704
Use code units cache API #2704
Conversation
I'm seeing indexing take 1m45s on core now, are you getting around the same? |
How are you measuring that? My benchmarks are showing an average of 29 seconds. |
20bf28e
to
50469d3
Compare
That was through VS Code, |
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.
I don't know yet know how else we'd do it, but it seems unfortunate that so many places in the code now need be aware of this cache.
Motivation
Closes #2674, closes #2671
This PR adopts the new code units cache API from Prism, so that code unit locations can be computed faster.
Implementation
I recommend reviewing by commit. The new API allows us to instantiate a code units cache ahead of time, which is then passed to get the code units in a more performant way. In places where we previously passed the encoding, we now pass the cache.
Note: this actually fixed a bug in the locations for semantic highlighting.
Automated Tests
Existing tests cover it, but I fixed one of them which had an incorrect expectation.