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

TS Optimization: see if there's a minimum length for LRU entries #43

Closed
connor4312 opened this issue Apr 15, 2024 · 1 comment
Closed

Comments

@connor4312
Copy link
Member

Currently, with the latest stack of performance improvement PRs, about 46% of the time is spent in the LRU. In my benchmark in the vscode repo is about breaks even whether the LRU is beneficial or not.

There might be a number of bytes for which string lengths under that level are not worth adding to the LRU because computing the tokens in byte pair encoding is faster. If so, skipping the LRU (both in get() and set()) would be faster.

In this case, the token array to append to can also be passed into bytePairEncode() to avoid allocating and then appending a new array if a small token doesn't need to generate a separate array to be stored in the LRU.

@connor4312
Copy link
Member Author

This didn't work out.

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

No branches or pull requests

1 participant