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
I found that in practice, use of DoubleArrayAhoCorasick::<V>::deserialize_unchecked() can be extremely slow. It typically takes 4-5s on my m1 (16gb ram) machine.
I'm happy to add serde's Serialize, and Deserialize trait (maybe under create's feature serde). I was able to get this to ~1s with Serde. Also, if we do this, we can skip unsafe. Let me know - happy to create a patch PR.
@ezkangaroo The DoubleArrayAhoCorasick structure internally uses unsafe functions, so I don't want to implement Serialize and Deserialize traits.
Instead, it is possible to use serde internally and provide a deserialization API as an unsafe function.
Although deserialize itself is a safe process, there is no guarantee that the automaton is correct, and in some cases memory access violations will occur, so the function must be unsafe to notify the user.
This is similar to String::from_utf8_unchecked, etc.
I found that in practice, use of
DoubleArrayAhoCorasick::<V>::deserialize_unchecked()
can be extremely slow. It typically takes 4-5s on my m1 (16gb ram) machine.Here are some stats:
The text was updated successfully, but these errors were encountered: