wirybeaver commented on code in PR #12242:
URL: https://github.com/apache/pinot/pull/12242#discussion_r1452592342
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/readers/forward/VarByteChunkSVForwardIndexReader.java:
##########
@@ -85,6 +85,10 @@ private String getStringCompressed(int docId,
ChunkReaderContext context) {
int length = valueEndOffset - valueStartOffset;
byte[] bytes = _reusableBytes.get();
+ if (bytes.length < _lengthOfLongestEntry) {
Review Comment:
*static threadLocal byte[] of IndexReader*
Pros: allocated only once per segment per thread;
Cons: memory won't be deallocated even no queries.
*threadLocal byte[] of ReaderContext and implement close() method to remove
threadLocal*
Pros: deallocate the memory in time when query gets finished.
Cons: repetitive allocation of byte[] array per query, query latency might
tumble; need to check the usage of ReaderContext carefully to ensure the
close() will be invoked finally after the query is completed (either failure or
success)
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]