database/sql: avoiding fmt.Sprintf while scanning, avoid allocs with RawBytes
A user reported heavy contention on fmt's printer cache. Avoid fmt.Sprint. We have to do reflection anyway, and there was already an asString function to use strconv, so use it. This CL also eliminates a redundant allocation + copy when scanning into *[]byte (avoiding the intermediate string) and avoids an extra alloc when assigning to a caller's RawBytes (trying to reuse the caller's memory). Fixes #7086 R=golang-codereviews, nightlyone CC=golang-codereviews https://golang.org/cl/50240044
Showing
Please register or sign in to comment