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

Use shorts instead of ints if the number of nodes is < 32K #8

Open
bzaar opened this issue Mar 9, 2016 · 0 comments
Open

Use shorts instead of ints if the number of nodes is < 32K #8

bzaar opened this issue Mar 9, 2016 · 0 comments

Comments

@bzaar
Copy link
Owner

bzaar commented Mar 9, 2016

My main use case involved 2.5M words that were represented using 150K nodes. But other users might have < 32K nodes in which case they may benefit from a 2x memory footprint cut (as if we haven't done enough!) It might be worth taking this number up to 64K-1 as we only need one special value.

If we are doing this, we may also want to think of users who might have more than 2G nodes and add a ulong version. Unlikely, but future-ready. Add a long version of GetNodeCount ().

I.e. add another template parameter to YaleDawg<TPayload>, TIndex which can be byte, ushort, uint or ulong and instantiate the required specialization based on the total number of nodes.

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