summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/stress_cache.cc
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-11 23:52:40 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-11 23:52:40 +0000
commit8df3407d293c6895ed8f95ad85c29bbef23443a5 (patch)
tree5fe723e790f74b0095ef519230c8aab31772a733 /net/disk_cache/stress_cache.cc
parentfcc21e89ce697257c2d64debe116c2df77ac7e6a (diff)
downloadchromium_src-8df3407d293c6895ed8f95ad85c29bbef23443a5.zip
chromium_src-8df3407d293c6895ed8f95ad85c29bbef23443a5.tar.gz
chromium_src-8df3407d293c6895ed8f95ad85c29bbef23443a5.tar.bz2
Disk Cache: Lower the definition of a loaded system from
10 pending operations to 5. Data from the Beta channel shows that for all group sizes except one, the 99.90% cutoff of number of pending operations falls below 5 (in fact, below 3). BUG=none TEST=none Review URL: http://codereview.chromium.org/164355 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23120 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/stress_cache.cc')
-rw-r--r--net/disk_cache/stress_cache.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/net/disk_cache/stress_cache.cc b/net/disk_cache/stress_cache.cc
index b2b60e4..7b5912c 100644
--- a/net/disk_cache/stress_cache.cc
+++ b/net/disk_cache/stress_cache.cc
@@ -25,6 +25,7 @@
#include "base/string_util.h"
#include "base/thread.h"
#include "net/base/io_buffer.h"
+#include "net/disk_cache/backend_impl.h"
#include "net/disk_cache/disk_cache.h"
#include "net/disk_cache/disk_cache_test_util.h"
@@ -77,10 +78,11 @@ void StressTheCache(int iteration) {
int cache_size = 0x800000; // 8MB
std::wstring path = GetCachePath();
path.append(L"_stress");
- disk_cache::Backend* cache = disk_cache::CreateCacheBackend(path, false,
- cache_size,
- net::DISK_CACHE);
- if (NULL == cache) {
+ disk_cache::BackendImpl* cache = new disk_cache::BackendImpl(path);
+ cache->SetFlags(disk_cache::kNoLoadProtection | disk_cache::kNoRandom);
+ cache->SetMaxSize(cache_size);
+ cache->SetType(net::DISK_CACHE);
+ if (!cache->Init()) {
printf("Unable to initialize cache.\n");
return;
}
@@ -123,6 +125,7 @@ void StressTheCache(int iteration) {
if (!(i % 100))
printf("Entries: %d \r", i);
+ MessageLoop::current()->RunAllPending();
}
}