Skip to content

perf: replace json.NewDecoder with json.Unmarshal in the om package #866

@rueian

Description

@rueian

As said in #864:

json.Decoder() copies data from the reader into a temporary buffer. This is an extra copy that is not necessary since we have the data as a slice already.

json.NewDecoder is not optimal for our use. We should replace the following with json.Unmarshal:

if err := json.NewDecoder(strings.NewReader(record)).Decode(&v); err != nil {

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions