diff --git a/bench_test.go b/bench_test.go index dc2299b7..933f5cba 100644 --- a/bench_test.go +++ b/bench_test.go @@ -69,11 +69,13 @@ func BenchmarkRedisSetString(b *testing.B) { {10, 1024}, {10, 64 * 1024}, {10, 1024 * 1024}, + {10, 10 * 1024 * 1024}, {100, 64}, {100, 1024}, {100, 64 * 1024}, {100, 1024 * 1024}, + {100, 10 * 1024 * 1024}, } for _, bm := range benchmarks { b.Run(bm.String(), func(b *testing.B) { diff --git a/internal/pool/conn.go b/internal/pool/conn.go index 4e3a608e..a70e818f 100644 --- a/internal/pool/conn.go +++ b/internal/pool/conn.go @@ -81,10 +81,11 @@ func (cn *Conn) EnableConcurrentReadWrite() { } func (cn *Conn) PrepareWriteBuffer() *proto.WriteBuffer { - if !cn.concurrentReadWrite { + if cn.concurrentReadWrite { + cn.wb.Reset() + } else { cn.wb.ResetBuffer(cn.Rd.Buffer()) } - cn.wb.Reset() return cn.wb }