Fastest string distance algorithm

Anyone know any good package for golang to do string distance calculation? I’m looking for nanosecond times comparing words.

It’s for a toy project, one of the requirements is to be fast, crazy fast.

What do you mean by distance?

https://github.com/arbovm/levenshtein looks pretty solid. It’s based on a fast algorithm, and is optimized. As always though, you should try a few solutions and profile.

there are a few packages out there doing string distance metrics. If you know the algorithm you want to use you could search for that. The two packages below have a few different string distance algorithms (edit distance, soundex, jarowinkler, etc…).

I linked to a specific edit distance implementation because it shows 4 different ways to do it, with varying trade-offs of accuracy and speed.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.