RFR: 8305767: HdrSeq: support for a merge() method

Y. Srinivas Ramakrishna ysr at openjdk.org
Fri Apr 21 18:03:44 UTC 2023


On Fri, 7 Apr 2023 23:03:02 GMT, William Kemper <wkemper at openjdk.org> wrote:

> A merge functionality on stats (distributions) was needed for the remembered set scan that I was using in some companion work. This PR implements a first cut at that, which is sufficient for our first (and only) use case.
> 
> Unfortunately, for expediency, I am deferring work on decaying statistics, as a result of which users that want decaying statistics will get NaNs instead (or trigger guarantees).

Those are both good questions:

> I have a general comment about this. It looks to me that the new method is actually bulk-add-er? So it should be e.g.:
> 
> ```
> class NumberSeq {
> ...
> public 
>  virtual void add(NumberSeq& other) { ... } // adds all points from another number sequence 
> ```
> 

Note that the merge direction is reversed. From `this` into `other`. This was based on how it was being used and with `this` expected to be sparser than `other`.

> Also, `clear_this` should probably be handled in a separate method (call).

The idea was to do the clearing while merging and avoid the extra walk over the bucket if the two calls were split.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/13395#issuecomment-1518162614


More information about the shenandoah-dev mailing list