misc optimizations
4meta5 opened this issue · comments
Amar Singh commented
will address when I feel like it, code is already clean now
- remove CharDNEinDict and make char conversion infallible, use 1i32
- use hashbrown::HashMap instead of BTreeMap
- look into using lifetimes instead of Rc
- map -> heap -> tree can definitely be improved to remove like 2-3 allocations per element per step
Deleted user commented
You could use an array of Option<u8>
for all ascii characters and then for any others use a HashMap
Deleted user commented
lifetimes with a tree would probably be impossible however you could have the root node store a vector of each node and then instead of Rc
use a index into the roots vector
Amar Singh commented
lifetimes with a tree would probably be impossible however you could have the root node store a vector of each node and then instead of
Rc
use a index into the roots vector
Interesting, I'd like to see this and compare benchmark results.