ivoleitao / stash

Key-value store abstraction with plain and cache driven semantics and a pluggable backend architecture.
MIT License
87 stars 16 forks source link

RandomSampler fix to return correct sample size #15

Closed ilikerobots closed 3 years ago

ilikerobots commented 3 years ago

Status

READY

Breaking Changes

NO

Description

Correct the RandomSampler logic such that it returns a sample of the correct size.

Todos

ilikerobots commented 3 years ago

I noted performance problems with high (~5000) key counts and traced it back to RandomSampler not effectively choosing a sample size. The above PR corrects this.

ivoleitao commented 3 years ago

Hi, thanks for this PR !

I don't know what I was thinking when I did this 😄 . It was obviously wrong...

LGTM

ivoleitao commented 3 years ago

I will do a release in the next weekend to fix this bug

ilikerobots commented 3 years ago

Great thanks!