Feature(Microservices): Replace io.ReadAll with io.Copy where possible
Problem Statement
io.ReadAll is used in many places to read all bytes from a buffer. It should be replaced with io.Copy or similar methods where possible. io.ReadAll will place the full buffer into memory, whereas io.Copy will copy bytes from one place to the other in 32Kb chunks, reducing memory usage drastically.
Who will benefit?
Everyone, memory usage will be reduced.
Benefits and risks
(+) Memory usage reduced
Priority/Severity
-
High (This will bring a huge increase in performance/productivity/usability/legislative cover) -
Medium (This will bring a good increase in performance/productivity/usability) -
Low (anything else e.g., trivial, minor improvements)