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

Better heap size estimate for HashMap and HashSet #10

Merged
merged 2 commits into from
Nov 8, 2022

Conversation

SimonSapin
Copy link
Contributor

The previous estimate was based on the previous implementation of HashMap and HashSet in the standard library.
Now the standard library uses the hashbrown crate, which has different internals:

  • One byte of metadata per bucket instead of one usize
  • Different load factor and reallocation strategy

The previous estimate was based on the previous implementation
of HashMap and HashSet in the standard library.
Now the standard library uses the `hashbrown` crate,
which has different internals:

* One byte of metadata per bucket instead of one usize
* Different load factor and reallocation strategy
Copy link
Contributor

@marc-casperlabs marc-casperlabs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good at first glance, but can you provide a short explanation why len took the place of capacity, possibly for future reference? I'd be happy to merge it afterwards!

datasize/src/std.rs Show resolved Hide resolved
Copy link
Contributor

@marc-casperlabs marc-casperlabs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me now!

@marc-casperlabs marc-casperlabs merged commit a010cca into CasperLabs:master Nov 8, 2022
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

Successfully merging this pull request may close these issues.

2 participants