-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Description
Proposal
The histogram decoder allocates a new object each time AtHistogram
or AtFloatHistogram
is called, and this takes a significant amount of CPU when executing queries. Furthermore, calling ToFloat
on a regular histogram also creates a new object and there is no good way to reuse memory during the execution of a query.
I've put together a quick benchmark to illustrate this problem: #13160. Note that even though the tooltip says 4.6% of all, that also includes the time required to set up the benchmark. The ToFloat
call actually takes around 30-40% of the query execution time.
I think this optimization is worth pursuing because it would lead to significant performance improvements for queries on native histograms. One solution could be to apply the same pattern that is used in SampleIterable
where the caller can provide an existing histogram object that can be reused. If nil
is provided, the decoder would allocate a new object.
Metadata
Metadata
Assignees
Type
Projects
Status