Skip to content

Commit

Permalink
Don't promote entries until they have been reused after a longer period
Browse files Browse the repository at this point in the history
  • Loading branch information
kriszyp committed Jan 7, 2022
1 parent 33d828e commit f8e2c97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion LRFUExpirer.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class LRFUExpirer {
let lru = this.lru[lruIndex]
// check to see if it is in the same generation
lruPosition = lru.position
if ((originalPosition > lruPosition ? lruPosition + this.lruSize : lruPosition) - originalPosition < (this.lruSize >> 3))
if ((originalPosition > lruPosition ? lruPosition + this.lruSize : lruPosition) - originalPosition < (this.lruSize >> 2))
return // only recently added, don't promote
lru[originalPosition & 0x3fffff] = null // remove it, we are going to move/promote it
lruIndex++
Expand Down

0 comments on commit f8e2c97

Please sign in to comment.