Open ekreutz opened 5 years ago
I just compared those two in a real-life application and editdistance is about 30% faster.
At least in my benchmarks this is largely dependent on the length of the input strings. Here is a comparision for different libraries using different string lengths. Both edlib and editdistance appear to have a lot of overhead for short strings.
Only python-Levenshtein uses a quadratic time implementation, while all others use Myers/Hyyrös bitparallel implementation.
@maxbachmann Great chart. It shows the choice of implementation really depends on the application.
For the latter rapidfuzz
seems like a good choice.
Hey, I ran a quick benchmark of my own on, using:
python-Levenshtein 0.12.0
(pypi)editdistance 0.5.3
(pypi)In my tests
python-Levenshtein
is about 10x faster. Perhaps it's the macOS binaries? Or maybe your tests are outdated?Prints: