couchbase / moss

moss - a simple, fast, ordered, persistable, key-val storage library for golang
Other
959 stars 58 forks source link

potential garbage of kvs pair during compactWriter.Mutate() #50

Open steveyen opened 7 years ago

steveyen commented 7 years ago

Saw this while doing a code review perusal, and wondering if the following allocates garbage...

pair := []uint64{opKlVl, uint64(keyStart)}

From: https://github.com/couchbase/moss/blob/master/store_compact.go#L534

If so, perhaps a pre-allocated pair can be held as part of the compactWriter and reused across multiple calls to compactWriter.Mutate()