1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-26 19:21:03 +03:00

Reuse buffer for constructing request.

This commit is contained in:
Vladimir Mihailenco
2012-08-14 18:20:22 +03:00
parent 625adac9ab
commit a2f5423658
8 changed files with 32 additions and 44 deletions

View File

@ -2412,7 +2412,7 @@ func (t *RedisTest) BenchmarkRedisWriteRead(c *C) {
c.Assert(err, IsNil)
for i := 0; i < 10; i++ {
err := t.client.WriteReq([]byte("PING\r\n"), conn)
err := t.client.WriteReq(conn, redis.NewStatusReq("PING"))
c.Assert(err, IsNil)
line, _, err := conn.Rd.ReadLine()
@ -2423,7 +2423,7 @@ func (t *RedisTest) BenchmarkRedisWriteRead(c *C) {
c.StartTimer()
for i := 0; i < c.N; i++ {
t.client.WriteReq([]byte("PING\r\n"), conn)
t.client.WriteReq(conn, redis.NewStatusReq("PING"))
conn.Rd.ReadLine()
}