Skip to content

Use smol_str in Ngram, yielding about a 15% speed boost - #16

Merged
compenguy merged 1 commit into
masterfrom
smolstr
Dec 2, 2025
Merged

compenguy merged 1 commit into
masterfrom
smolstr

Conversation

@compenguy

Copy link
Copy Markdown
Owner

It should also have a pretty measurable impact on memory footprint, although I haven't found a good way to benchmark memory usage in-benchmark yet.

Also bumping to 0.7 as this changes the public API for Ngram.

Additionally, removing TODOs about const generics, as they wind up making the API a little harder to use, and didn't yield any direct performance improvements (in fact, benchmarks seemed to suggest a few percentage points loss in performance).

It should also have a pretty measurable impact on memory footprint,
although I haven't found a good way to benchmark memory usage
in-benchmark yet.

Also bumping to 0.7 as this changes the public API for `Ngram`.

Additionally, removing TODOs about const generics, as they wind up
making the API a little harder to use, and didn't yield any direct
performance improvements (in fact, benchmarks seemed to suggest a few
percentage points loss in performance).
@compenguy
compenguy merged commit d66b378 into master Dec 2, 2025
1 check passed
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.

1 participant