-
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a flat vector in Damerau-Levenshtein
Instead of representing a 2x2 grid with a vector of vectors, just use a single vector to improve performance. We can do this since the dimensions are fixed. This method was suggested by @lovasoa as an alternative to adding a dependency on the ndarray crate. In my benchmark testing, the new approach is about as fast using ndarray. On my machine, the original approach takes about 22,000 ns/iter, whereas the new approach takes about 17,000 ns/iter. See #34 for more context.
- Loading branch information
Showing
1 changed file
with
21 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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