Open bee-san opened 2 years ago
Sure. Serialize it to a file and use something like once_cell to load it via include_bytes.
It won't help do anything faster at runtime though.
You might want a perfect hashmap instead. Not sure if 40 million is too big for that though.
Sure. Serialize it to a file and use something like once_cell to load it via include_bytes.
It won't help do anything faster at runtime though.
You might want a perfect hashmap instead. Not sure if 40 million is too big for that though.
Thank you @BurntSushi for your response to this question and your work with FST.
I've been thinking about this as well. Why would you say it wouldn't help? Baking the bytes into the binary would at least help during runtime in avoiding loading the map at runtime?
I'm just saying that building an fstv at compile time won't make queries faster. It's the same bytes. This is unlike a perfect hash map for example.
Obviously building an fst at compile time means you won't have to do it at runtime, and that may or may not be significant.
@BurntSushi Thank you for your clear response! 🚀 Learnt alot from it.
I have a problem which I think FST might solve:
Is it possible to build an FST at compile time to achieve (5)?