Closed kpango closed 6 years ago
I fixed wasteful JSON Body parsing, Use json.Decoder instead of json.Unmarshal & ioutil.ReadAll for json-parsing performance improvement.
see this benchmark document.
before
var target JSON body, err := ioutil.ReadAll(reader) if err != nil { return err } return json.Unmarshal(body, &target)
after
var target JSON return json.NewDecoder(reader).Decode(&target)
Thank you for submitting this pull request, however I do not see a valid CLA on file for you. Before we can merge this request please visit https://yahoocla.herokuapp.com/ and agree to the terms. Thanks! :smile:
👍
I fixed wasteful JSON Body parsing, Use json.Decoder instead of json.Unmarshal & ioutil.ReadAll for json-parsing performance improvement.
see this benchmark document.
before
after