summaryrefslogtreecommitdiff
path: root/desktop/netsurf.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2014-11-28 19:17:42 +0000
committerVincent Sanders <vince@kyllikki.org>2014-11-28 19:17:42 +0000
commit6b2676d33f2e6c25dc98eda57325e7185a6ff763 (patch)
treee416c75208b769643862a9a7b7e3d92e9ba0a624 /desktop/netsurf.c
parent5f57a39130aea9829ea9d870e55f4fb19d7cbec8 (diff)
downloadnetsurf-6b2676d33f2e6c25dc98eda57325e7185a6ff763.tar.gz
netsurf-6b2676d33f2e6c25dc98eda57325e7185a6ff763.tar.bz2
Improve llcache writeout stratagy
Diffstat (limited to 'desktop/netsurf.c')
-rw-r--r--desktop/netsurf.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/desktop/netsurf.c b/desktop/netsurf.c
index 21fedfddf..cca80232b 100644
--- a/desktop/netsurf.c
+++ b/desktop/netsurf.c
@@ -72,17 +72,23 @@
/** default time between content cache cleans. */
#define HL_CACHE_CLEAN_TIME (2 * IMAGE_CACHE_CLEAN_TIME)
-/** default minimum object time before object is pushed to backing store. */
-#define LLCACHE_MIN_DISC_LIFETIME (60 * 30)
-
-/** default maximum bandwidth for backing store writeout. */
-#define LLCACHE_MAX_DISC_BANDWIDTH (128 * 1024)
-
/** ensure there is a minimal amount of memory for source objetcs and
* decoded bitmaps.
*/
#define MINIMUM_MEMORY_CACHE_SIZE (2 * 1024 * 1024)
+/** default minimum object time before object is pushed to backing store. (s) */
+#define LLCACHE_STORE_MIN_LIFETIME (60 * 30)
+
+/** default minimum bandwidth for backing store writeout. (byte/s) */
+#define LLCACHE_STORE_MIN_BANDWIDTH (128 * 1024)
+
+/** default maximum bandwidth for backing store writeout. (byte/s) */
+#define LLCACHE_STORE_MAX_BANDWIDTH (1024 * 1024)
+
+/** default time quantum with which to calculate bandwidth (ms) */
+#define LLCACHE_STORE_TIME_QUANTUM (100)
+
static void netsurf_lwc_iterator(lwc_string *str, void *pw)
{
LOG(("[%3u] %.*s", str->refcnt, (int) lwc_string_length(str), lwc_string_data(str)));
@@ -126,8 +132,10 @@ nserror netsurf_init(const char *messages, const char *store_path)
.bg_clean_time = HL_CACHE_CLEAN_TIME,
.llcache = {
.cb = netsurf_llcache_query_handler,
- .minimum_lifetime = LLCACHE_MIN_DISC_LIFETIME,
- .bandwidth = LLCACHE_MAX_DISC_BANDWIDTH,
+ .minimum_lifetime = LLCACHE_STORE_MIN_LIFETIME,
+ .minimum_bandwidth = LLCACHE_STORE_MIN_BANDWIDTH,
+ .maximum_bandwidth = LLCACHE_STORE_MAX_BANDWIDTH,
+ .time_quantum = LLCACHE_STORE_TIME_QUANTUM,
}
};
struct image_cache_parameters image_cache_parameters = {