Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(433)

Issue 7765006: Disk cache: Don't evict anything for the first five (Closed)

Created:
9 years, 4 months ago by rvargas (doing something else)
Modified:
9 years, 3 months ago
Reviewers:
gavinp
CC:
chromium-reviews, cbentzel+watch_chromium.org, darin-cc_chromium.org
Visibility:
Public.

Description

Disk cache: Don't evict anything for the first five minutes. Basically, we don't want to do anything that may slow down startup. BUG=none TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=99059

Patch Set 1 #

Total comments: 6

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -4 lines) Patch
M net/disk_cache/backend_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M net/disk_cache/backend_impl.cc View 1 5 chunks +8 lines, -3 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
rvargas (doing something else)
9 years, 4 months ago (2011-08-26 23:23:25 UTC) #1
rvargas (doing something else)
ping
9 years, 3 months ago (2011-08-30 22:28:12 UTC) #2
gavinp
LGTM, with a small nit that you can ignore or not. http://codereview.chromium.org/7765006/diff/1/net/disk_cache/backend_impl.cc File net/disk_cache/backend_impl.cc (right): ...
9 years, 3 months ago (2011-08-31 02:20:32 UTC) #3
rvargas (doing something else)
Thanks http://codereview.chromium.org/7765006/diff/1/net/disk_cache/backend_impl.cc File net/disk_cache/backend_impl.cc (right): http://codereview.chromium.org/7765006/diff/1/net/disk_cache/backend_impl.cc#newcode1197 net/disk_cache/backend_impl.cc:1197: if (up_ticks_ < kTrimDelay * 2) // No ...
9 years, 3 months ago (2011-08-31 02:33:19 UTC) #4
gavinp
I'd say leave it the same rather than clamp it with kint32max. However, I argue ...
9 years, 3 months ago (2011-08-31 03:01:20 UTC) #5
rvargas (doing something else)
9 years, 3 months ago (2011-08-31 18:06:34 UTC) #6
Thanks

http://codereview.chromium.org/7765006/diff/1/net/disk_cache/backend_impl.cc
File net/disk_cache/backend_impl.cc (right):

http://codereview.chromium.org/7765006/diff/1/net/disk_cache/backend_impl.cc#...
net/disk_cache/backend_impl.cc:51: const int kTrimDelay = 10;
I see your point, but right now 30 seconds is kind of embedded in the code
(mostly relevant for UMA) and I don't want to give the impression that changing
the timer interval is as easy as changing a constant at the top of the file :(

http://codereview.chromium.org/7765006/diff/1/net/disk_cache/backend_impl.cc#...
net/disk_cache/backend_impl.cc:1197: if (up_ticks_ < kTrimDelay * 2)  // No need
to count forever.
On 2011/08/31 03:01:20, gavinp wrote:
> On 2011/08/31 02:33:19, rvargas wrote:
> > On 2011/08/31 02:20:32, gavinp wrote:
> > > Nit: Why not count forever?  Seems easier and less confusing.
> > 
> > Not easier because then I would have to either clamp the value or care about
> > integer overflows. To be fair, this is also a clamp, just at a lower value
(so
> > few instructions saved). I could as easily change the constant to be
kint32max
> > if you prefer it that way.
> 
> I'm not convinced a clamp is necessary, because if I'm not missing something,
> the overflow is about 2043 years, right?  Admittedly, since we use a signed
int,
> so after that we then would not evict cache entries for 2043 years + 5
minutes,
> which is a long time, and so the disk would probably get full...

Convinced. Clamp gone.

Powered by Google App Engine
This is Rietveld 408576698