You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Conn.Read function it always creates a new slice to read data. Reducing allocations can save significant amount of cpu time (alloc cpu time + gc cpu time). Instead of doing this, get a slice as an argument and read data into that slice. Also consider that the slice may not have enough space, therefore always return the slice with data which may or may not be the slice provided by the user.
In
Conn.Read
function it always creates a new slice to read data. Reducing allocations can save significant amount of cpu time (alloc cpu time + gc cpu time). Instead of doing this, get a slice as an argument and read data into that slice. Also consider that the slice may not have enough space, therefore always return the slice with data which may or may not be the slice provided by the user.This changes the method signature to:
The text was updated successfully, but these errors were encountered: