mirror of
https://github.com/apache/druid.git
synced 2025-02-25 20:48:05 +00:00
folding into direct buffers is faster
This commit is contained in:
parent
83ac1d323e
commit
c92fd6f45d
@ -66,10 +66,11 @@ public class HyperUniquesBufferAggregator implements BufferAggregator
|
||||
@Override
|
||||
public Object get(ByteBuffer buf, int position)
|
||||
{
|
||||
ByteBuffer dataCopyBuffer = ByteBuffer.allocate(HyperLogLogCollector.getLatestNumBytesForDenseStorage());
|
||||
ByteBuffer dataCopyBuffer = ByteBuffer.allocateDirect(HyperLogLogCollector.getLatestNumBytesForDenseStorage());
|
||||
ByteBuffer mutationBuffer = buf.duplicate();
|
||||
mutationBuffer.position(position);
|
||||
mutationBuffer.get(dataCopyBuffer.array());
|
||||
dataCopyBuffer.put(mutationBuffer);
|
||||
dataCopyBuffer.rewind();
|
||||
return HyperLogLogCollector.makeCollector(dataCopyBuffer);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user