eye-gu commented on code in PR #1110:
URL: 
https://github.com/apache/skywalking-banyandb/pull/1110#discussion_r3212475221


##########
banyand/measure/topn.go:
##########
@@ -935,32 +1225,96 @@ func (t *TopNValue) Unmarshal(src []byte, decoder 
*encoding.BytesBlockDecoder) e
                return fmt.Errorf("src is too short for reading string with 
size %d; len(src)=%d", valueLen, len(src))
        }
 
-       t.values, err = encoding.BytesToInt64List(t.values, src[:valueLen], 
t.encodeType, t.firstValue, int(valuesCount))
+       intValues, err := encoding.BytesToInt64List(nil, src[:valueLen], 
t.encodeType, t.firstValue, int(valuesCount))

Review Comment:
   @hanahmily Both int64 and float64 unmarshal paths now pass t.intScratch[:0] 
to reuse the pooled buffer, and t.entityTagNames also reuses capacity on 
re-allocation.
   
   Re: the valuesCount > payload bytes check — I didn't add it. With delta 
encoding, a single value is stored in firstValue with valueLen = 0 , so 
valuesCount=1 with zero payload bytes is valid.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to