Open ryan-berger opened 2 years ago
I noticed that here You call json.Marshal on the response, which would load the entire response in to memory before writing it out.
json.Marshal
It may be a better idea to do:
err := json.NewEncoder(request.Body).Encode(&response)
This could improve memory consumption which could in-turn improve garbage collection performance. I'm not 100% sure on it though, just a thought
I noticed that here You call
json.Marshal
on the response, which would load the entire response in to memory before writing it out.It may be a better idea to do:
This could improve memory consumption which could in-turn improve garbage collection performance. I'm not 100% sure on it though, just a thought