lib / pq

Pure Go Postgres driver for database/sql
https://pkg.go.dev/github.com/lib/pq
MIT License
9.11k stars 911 forks source link

Reduce writeBuf.string run-time by 87.68% #877

Closed tsenart closed 5 years ago

tsenart commented 5 years ago
name                 old time/op    new time/op    delta
_writeBuf_string-16    14.8ns ± 0%     1.8ns ± 0%  -87.68%  (p=0.000 n=12+15)

name                 old alloc/op   new alloc/op   delta
_writeBuf_string-16     0.00B          0.00B          ~     (all equal)

name                 old allocs/op  new allocs/op  delta
_writeBuf_string-16      0.00           0.00          ~     (all equal)
johto commented 5 years ago

"\000"... is probably better written as '\000', yes?

tsenart commented 5 years ago

@johto: Yep, thanks.