You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not really a good idea in terms of this library, since in most use cases it it uncommon to call the function twice with the two same strings. If this is really common in you specific case, it makes more sense to write yourself a wrapper function adding the lru_cache for your own project.
Levenshtein distance algorithm can't be vectorized.
So the calculation would be very slow in large data.
An idea to speed up is using the cache.
Use the
accumulate
case to show the cache.accumulate(100000000)
needs 5s no matter if it is the first time running or the second time running in my local withoutlru_cache
.After adding
lru_cache
, the first runningaccumulate(100000000)
still needs 5s.But the second time running
accumulate(100000000)
needs 0s.The text was updated successfully, but these errors were encountered: