Instead of allocating new hashes and arrays as default values, this commit reuses the same frozen empty constant. It also short circuits the parse_* methods when they see an empty array/hash.
In our app this takes us from 58441 live objects allocated in this file to 24850.
Instead of allocating new hashes and arrays as default values, this commit reuses the same frozen empty constant. It also short circuits the
parse_*
methods when they see an empty array/hash.In our app this takes us from 58441 live objects allocated in this file to 24850.