From 9bb76dc6ebababd841474c50f9d1e5a3072ed363 Mon Sep 17 00:00:00 2001 From: maypok86 Date: Mon, 11 Dec 2023 19:55:27 +0300 Subject: [PATCH] [Chore] Improve expiry policy --- internal/expire/policy.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/internal/expire/policy.go b/internal/expire/policy.go index 00ead62..2f8db35 100644 --- a/internal/expire/policy.go +++ b/internal/expire/policy.go @@ -8,9 +8,9 @@ import ( ) const ( - numberOfBuckets = 16 + numberOfBuckets = 128 mask = uint64(numberOfBuckets - 1) - base = uint64(10) + base = uint64(5) // eliminate probing. maxProbeCount = 100 @@ -19,10 +19,6 @@ const ( mapSize = 100 ) -func timestampToBucketID(timestamp uint64) int { - return bucketTimeToBucketID(timestampToBucketTime(timestamp)) -} - func bucketTimeToBucketID(bucketTime uint64) int { return int(bucketTime & mask) }