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

Add worstcase benchmark #23

Merged
merged 2 commits into from
Oct 4, 2024
Merged

Conversation

hendrikvanantwerpen
Copy link
Contributor

Adds a benchmark that brings out the worst in tiktoken.

I tried to understand how the splitting regexes actually work, but that was kind of annoying.
Just selecting ranges from the whole Unicode set excluding whitespace seems to do the trick though.

If we want to ensure it really is the worst case, I can try again to understand the regexes, or we just reject inputs that can be split using the regex (assuming most cannot).

I've also added the graph for this benchmark to the readme.

@hendrikvanantwerpen hendrikvanantwerpen merged commit 1d02b2e into main Oct 4, 2024
3 checks passed
@hendrikvanantwerpen hendrikvanantwerpen deleted the add-worstcase-benchmark branch October 4, 2024 12:21
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.

2 participants