Bench bigget values

This commit is contained in:
Vladimir Mihailenco 2018-08-15 09:10:53 +03:00
parent ef3e0e9827
commit cfe305296f
2 changed files with 5 additions and 2 deletions

View File

@ -69,11 +69,13 @@ func BenchmarkRedisSetString(b *testing.B) {
{10, 1024}, {10, 1024},
{10, 64 * 1024}, {10, 64 * 1024},
{10, 1024 * 1024}, {10, 1024 * 1024},
{10, 10 * 1024 * 1024},
{100, 64}, {100, 64},
{100, 1024}, {100, 1024},
{100, 64 * 1024}, {100, 64 * 1024},
{100, 1024 * 1024}, {100, 1024 * 1024},
{100, 10 * 1024 * 1024},
} }
for _, bm := range benchmarks { for _, bm := range benchmarks {
b.Run(bm.String(), func(b *testing.B) { b.Run(bm.String(), func(b *testing.B) {

View File

@ -81,10 +81,11 @@ func (cn *Conn) EnableConcurrentReadWrite() {
} }
func (cn *Conn) PrepareWriteBuffer() *proto.WriteBuffer { func (cn *Conn) PrepareWriteBuffer() *proto.WriteBuffer {
if !cn.concurrentReadWrite { if cn.concurrentReadWrite {
cn.wb.Reset()
} else {
cn.wb.ResetBuffer(cn.Rd.Buffer()) cn.wb.ResetBuffer(cn.Rd.Buffer())
} }
cn.wb.Reset()
return cn.wb return cn.wb
} }