Skip to content

jlexer: Support io.Reader and read in chunks #287

Open
@mrVanboy

Description

@mrVanboy

Hi! Thanks for a great library, we are using it a lot in our projects.

What I found today interesting in our profiler, that easyjson.UnmarshalFromReader reads everything from the io.Reader before further processing, which causes huge allocations in case of large data stored in the provided Reader. Yep, it's mentioned in the documentation of the easyjson.UnmarhsalFromReader, but I see here space for improvement.

Profiler screenshot

image

Have you considered reading and parsing chunks of the bytes from io.Reader?

It could help with parsing huge data from net/http.Response.Body as in documentation has mentioned:

The response body is streamed on demand as the Body field
is read...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions