Descriptiondatabase/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 Issue 7086
Patch Set 1 #Patch Set 2 : diff -r e4b3e3c1edda https://go.googlecode.com/hg/ #Patch Set 3 : diff -r e4b3e3c1edda https://go.googlecode.com/hg/ #Patch Set 4 : diff -r b4280f484ccf https://go.googlecode.com/hg/ #
MessagesTotal messages: 3
|