Commit 29d5ef1
fix TDigest::merge using oversized vectors of centroids
Summary:
When joining multiple `TDigest` instances into one using `TDigest::merge(Range<const TDigest*>)`, more than `maxSize` elements appear in the `centroids` vector periodically. This happens because of the missing `k_limit` increment during `q_limit_times_count` initialisation. This diff fixes it.
It is hard to say if this bug causes any issues with the precision of the highest percentiles. But it causes some performance degradation: unplanned multiple merging, additional vector resizes etc. It can also lead to more serious bugs as nobody expects the centroids vector to be bigger than was specified.
Reviewed By: yfeldblum
Differential Revision: D71970273
fbshipit-source-id: 2fea55846426a9986d3d0854b387d321b6e31ed11 parent 07ce472 commit 29d5ef1
1 file changed
+5
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
| 192 | + | |
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
| 215 | + | |
215 | 216 | | |
216 | 217 | | |
217 | 218 | | |
| |||
317 | 318 | | |
318 | 319 | | |
319 | 320 | | |
320 | | - | |
| 321 | + | |
321 | 322 | | |
322 | 323 | | |
323 | 324 | | |
324 | 325 | | |
325 | 326 | | |
326 | 327 | | |
327 | 328 | | |
328 | | - | |
| 329 | + | |
329 | 330 | | |
330 | 331 | | |
331 | 332 | | |
| |||
339 | 340 | | |
340 | 341 | | |
341 | 342 | | |
| 343 | + | |
342 | 344 | | |
343 | 345 | | |
344 | 346 | | |
| |||
0 commit comments