Aggregation pipelines often own multiple partial TDigestMut states. Repeated borrowed merge calls recompress intermediate results, so consuming an iterator of digests should combine them with one compression pass while retaining the existing borrowed API.
PR #261 explored FromIterator<TDigestMut>. A first implementation collected sorted slices into a BinaryHeap and then collected all centroids again, which added allocations and obscured the data flow. The revised approach lazily k-way merges fully compressed sorted buffers directly into compression; inputs with unsorted update tails are materialized and stably sorted once because sorting every tail separately was slower.
A focused PR should cover empty and single inputs, mixed k values, stable tie ordering, compressed and uncompressed inputs, allocation-aware benchmarks, and the clone tradeoff between borrowed merge and consuming collection.
Aggregation pipelines often own multiple partial
TDigestMutstates. Repeated borrowedmergecalls recompress intermediate results, so consuming an iterator of digests should combine them with one compression pass while retaining the existing borrowed API.PR #261 explored
FromIterator<TDigestMut>. A first implementation collected sorted slices into aBinaryHeapand then collected all centroids again, which added allocations and obscured the data flow. The revised approach lazily k-way merges fully compressed sorted buffers directly into compression; inputs with unsorted update tails are materialized and stably sorted once because sorting every tail separately was slower.A focused PR should cover empty and single inputs, mixed
kvalues, stable tie ordering, compressed and uncompressed inputs, allocation-aware benchmarks, and the clone tradeoff between borrowedmergeand consuming collection.