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

Added optional support for mem-dbg #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

LucaCappelletti94
Copy link
Contributor

Hi - I have added optional support for the mem-dbg crate, guarded behind the mem-dbg feature. I have also added optional support for enabling std, which is needed at this time for mem-dbg.

Copy link
Owner

@eldruin eldruin left a comment

Choose a reason for hiding this comment

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

Thank you for your work.
I do wonder if it is worth adding mem-dbg as dependency, though. It seems to me like a one-off check. I think that would be better done with a fork and [patch.crates-io].
Can you elaborate your use-case?

@LucaCappelletti94
Copy link
Contributor Author

The gist of my use is that I am comparing several libraries that use different hash functions (stuff for set cardinality estimation) and testing how performance changes with different hashes.

Some of these libraries chose to have the Hasher or the HasherBuilder object not like a Phantom Type marker, but as an effective part of their struct and therefore it needs to be accounted for by mem_dbg. With the MemSize trait derived on the structs of this crate, the memory requirements computation becomes trivial. I have already merged pull requests in several of these aforementioned libraries adding an analogous feature flag, so integrating it also here would facilitate this considerably.

While I agree wholeheartedly that having it as a default dependency would be a rather poor life choice, I believe that having it as an optional dependency should be okay. Do you agree?

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