We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have a test:
func TestRistretto_Get(t *testing.T) { require := require.New(t) const CacheSize = 10_000 m, err := ristretto.NewCache(&ristretto.Config{ NumCounters: CacheSize / 10, // number of keys to track frequency MaxCost: CacheSize, // maximum cost of cache BufferItems: 64, // number of keys per Get buffer. }) require.NoError(err) numFound := 0 numMissed := 0 for i := 0; i < CacheSize; i++ { k := fmt.Sprint(i) for { r := m.Set(k, i+1, 1) m.Wait() if r { break } } _, ok := m.Get(k) if !ok { numMissed++ } else { numFound++ } } fmt.Println("numOk:", numFound, "numMissed:", numMissed) require.NotNil(t) }
It prints numOk: 3494 numMissed: 6506. Is it ok that so many keys are missed?
numOk: 3494 numMissed: 6506
The text was updated successfully, but these errors were encountered:
This issue has been stale for 60 days and will be closed automatically in 7 days. Comment to keep it open.
Sorry, something went wrong.
No branches or pull requests
Question.
I have a test:
It prints
numOk: 3494 numMissed: 6506
. Is it ok that so many keys are missed?The text was updated successfully, but these errors were encountered: