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

Horrible regex performance (30x slower than original tiktoken) #7

Open
l0rinc opened this issue Jan 16, 2024 · 0 comments
Open

Horrible regex performance (30x slower than original tiktoken) #7

l0rinc opened this issue Jan 16, 2024 · 0 comments

Comments

@l0rinc
Copy link

l0rinc commented Jan 16, 2024

Checking the performance against the original tiktoken (written in Rust) and against the Java port, the Dart regex fragment parser is insanely slow (roughly 30x slower).
image

Even simple regex optimizations don't help since Dart doesn't seem to support possessives (and is most likely slow because of backtracking).

A dedicated cl100k parser could help - as done in knuddelsgmbh/jtokkit#77.

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