599166320 opened a new issue, #12902:
URL: https://github.com/apache/druid/issues/12902

   ### Motivation
   
   When I used the Druid histogram extension to calculate the quantile value, I 
found that the performance was too poor compared with the exact quantile value 
of Clickhouse.
   
   Through Arthas's monitor tool to monitor the aggregate function of 
FixedbuckethistogramBufferAggregator, I found that nearly 40% of the overhead 
is spent on serialization and deserialization. In order to avoid the overhead 
in this aspect, I try to change the intermediate results from the offheap 
memory to onheap memory of the JVM to avoid the overhead of serialization and 
deserialization of intermediate results. The query performance is optimized 
from more than 10s to more than 3S.
   
   #### offheap
   
   
![image](https://user-images.githubusercontent.com/3204398/184663391-f4e22b7e-9e0c-4c1f-bc36-a9c2cf0dfc6b.png)
   
   
   #### onheap
   
   
![image](https://user-images.githubusercontent.com/3204398/184663558-d29a62fc-34dd-4a37-8c42-492732fc13a5.png)
   
   
   ### Proposed changes
   Add a cache in the FixedbucketshistogramBufferaggregator class to save the 
intermediate results. 
   
   ###  Rationale
   Use jvm onheap memory to save temporary results, avoiding unnecessary 
serialization and deserialization overhead.
   
   
   


-- 
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]

Reply via email to