Skip to content

Speed of levenshtein #21

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

Closed
reza1615 opened this issue Sep 19, 2020 · 2 comments
Closed

Speed of levenshtein #21

reza1615 opened this issue Sep 19, 2020 · 2 comments

Comments

@reza1615
Copy link

Thank you for your great package
I compared this package speed with other cpython pakages and it is slower.
is it possible to improve the speed?

a = 'fsffvfdsbbdfvvdavavavavavava'
b = 'fvdaabavvvvvadvdvavavadfsfsdafvvav'
# levenshtein
%%timeit
import editdistance
editdistance.eval(a, b)
# 2.12 µs ± 14.1 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)

%%timeit
from strsimpy.levenshtein import Levenshtein
Levenshtein = Levenshtein()
Levenshtein.distance(a,b)
# 528 µs ± 990 ns per loop (mean ± std. dev. of 7 runs, 1000 loops each)```
@github-actions
Copy link

Thanks for your first issue!

@luozhouyang
Copy link
Owner

editdistance is fast because it is implemented in C++. But this library is purely implemented in Python, so it is much slower.

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

2 participants