Skip to content

Investigate micro-benchmark JSON.dump performance #655

Description

@byroot

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? Implement Factory#pool msgpack/msgpack-ruby#266
  • JSON.dump_default_options makes it hard to automatically re-use a State, but there might be some creative solution.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions