lib/pq — pull request #122 by edsrzf (2013-08-04 22:38:33+00:00)
Title: Use scratch buffer instead of allocating in lots of places

The size of the buffer is fairly arbitrary. I'm open to suggestions for making it larger or smaller.

Improvements:

benchmark old ns/op new ns/op delta
BenchmarkSelectString 327049 308282 -5.74%
BenchmarkSelectSeries 818056 727728 -11.04%
BenchmarkMockSelectString 8883 5910 -33.47%
BenchmarkMockSelectSeries 67110 49027 -26.95%
BenchmarkPreparedSelectString 113551 116031 +2.18%
BenchmarkPreparedSelectSeries 391017 332082 -15.07%
BenchmarkMockPreparedSelectString 3467 2392 -31.01%
BenchmarkMockPreparedSelectSeries 61802 45087 -27.05%

(The slight regression on BenchmarkPreparedSelectString is probably just noise.)