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

Suggestion: speed improvement - hashmap implementation #1722

Open
royweiss1 opened this issue Jan 15, 2025 · 0 comments
Open

Suggestion: speed improvement - hashmap implementation #1722

royweiss1 opened this issue Jan 15, 2025 · 0 comments

Comments

@royweiss1
Copy link

Why not use the faster hash map of Rust—fxhash? For a hash map that stores tokens, performance should be the priority, and fxhash offers a noticeable speed advantage.

Even tiktoken's implementation acknowledges a 5-10% performance gain by using FxHashMap over the standard HashMap:

// Hashing
// =======
// We use FxHashMap instead of the standard HashMap. This is maybe like a 5-10% win?

This will be an easy patch for performance!

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