-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
In #19599 we were discussing adding a heap_size() method to Statistics, which requires adding a similar method to all of the structs it references. The idea occurred that there are already crates to handle this sort of thing, namely:
- Our own HeapSize trait in
arrow-rs - deepsize which is now unmaintained and it's maintained but less widely used fork
It seems that if we're going to be implementing this for multiple structs it would be nice to at least have a derivable trait and use that trait everywhere.
One choice is between using a 3rd party crate or our own trait. Another choice is what the semantics we want are, the most confusing one perhaps being ref counted pointers (Arc, Rc, etc.).
Having thought about it a bit I think we should go with HeapSize and buff that trait up to provide a macro, implement it for the standard library container types, etc.
That said I'm opening the issue to collect community feedback if anyone has opinions.