Use `ObjectSpace.memsize_of` instead of serializing every variable
RobinDaugherty opened this issue · comments
Robin Daugherty commented
From comments on #402.
Currently, each variable is serialized, and the serialized value's length is compared to maximum_variable_inspect_size
. This is definitely not the fastest way to do this.
(Not all platforms necessarily have ObjectSpace.memsize_of
, so the current method might need to be used as a fallback.
Xavier J Ortiz commented
Hello @RobinDaugherty . I'd like to take a stab at this if nobody is working on it yet.
Full disclosure, this would be my first contribution to the project, and one of my first open source contribs in general. If this is OK, then I'm in!