Add: Bounded Levenshtein membership benchmarks - #9
Closed
grouville wants to merge 3 commits into
Closed
Conversation
Benchmarks szs.LevenshteinWithinK (bound cross-product, cmp/s) against
cutoff-capable baselines: polyleven with a bound, rapidfuzz with
score_cutoff (scalar), and rapidfuzz cdist (batched, all cores) - the
strongest bounded-distance baseline.
Selectivity is controllable via STRINGWARS_WITHIN_CANDIDATES: 'random'
(reject-heavy natural mix, category within_k), 'mutated' (every candidate
is a within-bound mutation of its diagonal query, accept-heavy worst
case, category within_k_accepts), or 'both'. Bounds come from
STRINGWARS_WITHIN_K (default '1,2,4').
measure_crossproduct and measure_pairwise_baseline gain a report unit
parameter so membership kernels report pairs/s ('comparisons') instead
of CUPS, which misstates bounded kernels that never fill the DP matrix.
Signed-off-by: Guillaume de Rouville <guillaume.derouville@gmail.com>Signed-off-by: Guillaume de Rouville <guillaume.derouville@gmail.com>
Signed-off-by: Guillaume de Rouville <guillaume.derouville@gmail.com>
grouvilleforce-pushed
the
levenshtein-within-k-bench
branch
from
August 15, 2026 18:44
1f81925 to
37971bdCompareAuthor
Closing this for now because StringZilla #336 no longer adds the dense all-pairs API measured here. I am keeping the branch so we can revisit the benchmark if we add that API later. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a benchmark for checking whether every pair of strings is within a given Levenshtein distance.
I started it while working on StringZilla #336, but that work now focuses on a different use case: building a dictionary once and searching it many times