BetterErrors / better_errors

Better error page for Rack apps
MIT License
6.88k stars 437 forks source link

Use `ObjectSpace.memsize_of` instead of serializing every variable #412

Closed RobinDaugherty closed 6 years ago

RobinDaugherty commented 6 years ago

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 6 years ago

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!