You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by "jmalkin (via GitHub)" <gi...@apache.org> on 2025/03/10 07:27:17 UTC
Re: [I] Reservoir sampling improvements (datasketches-java)
jmalkin commented on issue #647:
URL: https://github.com/apache/datasketches-java/issues/647#issuecomment-2709655245
I think option 3 (with the integer array approach ends up winning here. No side-effects, no worrying about whether a sample has or hasn't already been shuffled. And since a merge needs only `k` samples, I can get away with a modified Fisher-Yates shuffle with early stopping such that I only permute the number of items I need each time. That'll mean only `k` random draws to permute per merge rather than `2k`.
--
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: commits-unsubscribe@datasketches.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org