Skip to content
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

add fst data structure #17

Merged
merged 1 commit into from
May 14, 2019
Merged

add fst data structure #17

merged 1 commit into from
May 14, 2019

Conversation

missinglink
Copy link
Member

@missinglink missinglink commented May 13, 2019

A graph structure which is very efficient for querying prefix (or postfix) matches.

I actually didn't test the performance yet but it should be O(log n) which is better than our existing O(n) approach.
... or something like that, actually n has no relevance, it's simply O(c) where c is the number of characters in the word.

Copy link
Member

@Joxit Joxit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why, but it seems that the structure is slower than expected as replacement for Set....

The benchmark : https://gist.github.com/Joxit/32ccd5b5f63b474f30e707d804cbda25

@missinglink
Copy link
Member Author

I just pushed some new commits which refactor it, it's only intended to be used for prefix and suffix queries.

@Joxit
Copy link
Member

Joxit commented May 14, 2019

That's cool, you also added metadata 😄

@missinglink
Copy link
Member Author

missinglink commented May 14, 2019

I had a play with your benchmarking tool and I think there is something wrong with my FST implementation which makes it use way too much RAM.
I merged it anyway but I might need to do some more tuning before we start using it for real :)

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

Successfully merging this pull request may close these issues.

2 participants