Shared by @fractaledmind: https://gist.github.com/fractaledmind/b309ba91fa9f0fe52e87a7399f162f56 Refactored to re-use the generator: https://gist.github.com/byroot/a79fc8008c5c866d90defe4c9644d4e1 - [ ] Even re-using generator there is still a `1.2x` difference, so need to look into that. - [ ] Would be good to better document how to re-use generator state - [ ] Perhaps even offer first class API to re-use like I did with `MessagePack::Factory::Pool`? https://github.com/msgpack/msgpack-ruby/pull/266 - [ ] `JSON.dump_default_options` makes it hard to automatically re-use a `State`, but there might be some creative solution.