Skip to content

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

@l0rinc

Description

@l0rinc

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions