davecromberge opened a new pull request, #758: URL: https://github.com/apache/datasketches-java/pull/758
`getResult()` clones the gadget's whole hash table on every call for an on-heap gadget. The clone is there because `selectExcludingZeros` permutes the array it is given, but that only runs when the gadget holds more than `k`. Below that, `count()` and `compactCache()` only read, so the gadget's table can be read in place. For a union that ends in exact mode this removes the dominant allocation of `getResult()`: 73,800 to 8,248 bytes per call at lgK=12, and 294,984 to 32,824 at lgK=14. Estimation mode is unchanged. Added `ThetaUnionGetResultNonDestructiveTest`. The case that matters is `checkDuplicatesStillDetectedAfterGetResultRanQuickSelect`: permuting the gadget's table does not change what `getResult` returns and it heals at the gadget's next rebuild, so the only observable symptom is that known values stop counting as duplicates. -- 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]
