• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ben-manes / caffeine / #2558
100%

Build:
DEFAULT BRANCH: master
Ran 15 Feb 2021 04:37AM UTC
Jobs 1
Files 77
Run time 5s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
#2558

push

other

ben-manes
Eagerly evict an entry if it too large to fit in the cache

When an entry's weighted size exceeds the cache's maximum size, then
it can be evicted immediately and avoid flushing existing entries.
Some protection was already built in, but it was not robust to cover
all edge cases. Thus, it could flush some entries such as the entire
admission window on insert, or many others on an update.

When the entry is being inserted or updated in the admission window
then it is bounded by the window's maximum size (e.g. 1% of total).
If so, then the entry is placed immediately at the window's LRU
position so that it is promoted into the main space and treated as
an eviction candidate.

When the entry resides in the main space then it is bounded by the
cache's maximum size. It is moved to the window's LRU position so
that it becomes the eviction candidate.

This improved protection can cause a weighted cache to  discard the
most recently added entry. We typically try to minimize that to
avoid surprises, as one generally assumes a different victim will
be chosen. On a subsequent add the entry may be retained, thanks
to building up its frequency. Therefore, the preference is to
protect the cache at the cost of breaking an invalid assumption
for those step debugging through a sequence of operations.

6263 of 6769 relevant lines covered (92.52%)

0.93 hits per line

Jobs
ID Job ID Ran Files Coverage
1 #2558.1 15 Feb 2021 04:37AM UTC 0
92.52
Source Files on build #2558
Detailed source file information is not available for this build.
  • Back to Repo
  • 464bc191 on github
  • Prev Build on master
  • Next Build on master
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc