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

Reduce memory usage #31

Open
shanecelis opened this issue Apr 30, 2024 · 0 comments
Open

Reduce memory usage #31

shanecelis opened this issue Apr 30, 2024 · 0 comments

Comments

@shanecelis
Copy link
Collaborator

Now that we have mem_dbg present, we can determine the memory usage. And presently the trie is larger than the dictionary in memory, which surprised me.

$ cargo test --features mem_dbg memsize -- --nocapture
running 1 test
Reading dictionary file from: /Users/shane/Projects/trie-rs/benches/edict.furigana
Read 185536 words, 3531819 bytes.
Trie size 4174393
Uncompressed size 7984707
test trie::trie_impl::search_tests::memsize ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 114 filtered out; finished in 7.17s

I fear it may be because of adding the value on the map. My idea for tackling that is to try changing the TrieLabel into an enum instead of a struct. Then a TrieLabel::Value will mean its parent is the last Label of that entry.

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

No branches or pull requests

1 participant