Skip to content

Each decode() allocates a fresh parser with large default buffers #69

Description

@devcrocod

Every call to decode() creates a brand-new parser instance with the default capacity, which reserves tens of MiB of buffers. For repeated decoding (e.g. many small JSON payloads in a loop), this is a lot of avoidable allocation and GC pressure.

See SimdJson.kt.

Worth reusing a parser instance (with appropriate thread-safety/reset handling) across decode calls instead of allocating one per call.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingseverity: mediumMedium severity

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions