diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-13 18:10:51 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-13 18:10:51 +0000 |
commit | c03b9793bb64f1a4b819b74aabc21a70539e018a (patch) | |
tree | 2d0a151cef9e9b9d11bbd7ebc0b0d40b24e5f12f /net/disk_cache/eviction.cc | |
parent | e5368488e2fdad1cf27d6c0fd1031769affbaa5e (diff) | |
download | chromium_src-c03b9793bb64f1a4b819b74aabc21a70539e018a.zip chromium_src-c03b9793bb64f1a4b819b74aabc21a70539e018a.tar.gz chromium_src-c03b9793bb64f1a4b819b74aabc21a70539e018a.tar.bz2 |
Disk Cache: Run another experiment: Increase the number
of deleted entries that we keep around.
I'm doubling the number of deleted entries for about
13% of the dev channed.
I'm also adding a few extra histograms.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3343010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59243 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/eviction.cc')
-rw-r--r-- | net/disk_cache/eviction.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/net/disk_cache/eviction.cc b/net/disk_cache/eviction.cc index da7577c..0173c16 100644 --- a/net/disk_cache/eviction.cc +++ b/net/disk_cache/eviction.cc @@ -7,7 +7,7 @@ // only one list in use (Rankings::NO_USE), and elements are sent to the front // of the list whenever they are accessed. -// The new (in-development) eviction policy ads re-use as a factor to evict +// The new (in-development) eviction policy adds re-use as a factor to evict // an entry. The story so far: // Entries are linked on separate lists depending on how often they are used. @@ -35,6 +35,7 @@ #include "base/time.h" #include "net/disk_cache/backend_impl.h" #include "net/disk_cache/entry_impl.h" +#include "net/disk_cache/experiments.h" #include "net/disk_cache/histogram_macros.h" #include "net/disk_cache/trace.h" @@ -81,6 +82,7 @@ void Eviction::Init(BackendImpl* backend) { delay_trim_ = false; trim_delays_ = 0; init_ = true; + in_experiment_ = (header_->experiment == EXPERIMENT_DELETED_LIST_IN); } void Eviction::Stop() { @@ -451,8 +453,14 @@ void Eviction::TrimDeleted(bool empty) { deleted |= RemoveDeletedNode(node.get()); } + // Normally we use 25% for each list. The experiment doubles the number of + // deleted entries, so the total number of entries increases by 25%. Using + // 40% of that value for deleted entries leaves the size of the other three + // lists intact. + int max_length = in_experiment_ ? header_->num_entries * 2 / 5 : + header_->num_entries / 4; if (deleted && !empty && - header_->lru.sizes[Rankings::DELETED] > header_->num_entries / 4) + header_->lru.sizes[Rankings::DELETED] > max_length) MessageLoop::current()->PostTask(FROM_HERE, factory_.NewRunnableMethod(&Eviction::TrimDeleted, false)); |