From 1214f775197e7be7a2b7b337dc4d6f54ffd3deb8 Mon Sep 17 00:00:00 2001 From: Yicheng Qin Date: Thu, 19 Nov 2015 09:53:31 -0800 Subject: [PATCH] storage: set revBytes capacity to avoid malloc when appending mark This is a performance optimization. --- storage/revision.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/revision.go b/storage/revision.go index 47eb6ee0a..d2b0458d5 100644 --- a/storage/revision.go +++ b/storage/revision.go @@ -37,7 +37,7 @@ func (a revision) GreaterThan(b revision) bool { } func newRevBytes() []byte { - return make([]byte, revBytesLen) + return make([]byte, revBytesLen, markedRevBytesLen) } func revToBytes(rev revision, bytes []byte) {