Changeset 201857 in webkit


Ignore:
Timestamp:
Jun 9, 2016 1:41:54 AM (8 years ago)
Author:
Antti Koivisto
Message:

Increase disk cache capacity when there is lots of free space
https://bugs.webkit.org/show_bug.cgi?id=158526

Reviewed by Chris Dumez.

Our maximum disk cache capacity has been 175MB for a very long time. Meanwhile the average resource size has grown
massively. 175MB is now enough for cacheable resources of a few dozen sites at most. Using bigger caches when there is
room for it can reduce network traffic, reduce disk writes, save battery and speed up page loading.

This patch changes cache size for PrimaryWebBrowser cache model

=16GB free: 175MB -> 500MB

8-16GB free: 150MB -> 250MB

and modestly for DocumentBrowser

=16GB free: 50MB -> 75MB

Note that if system (on Cocoa platforms) really needs disk space it will wipe out caches so this doesn't reduce
available disk space in scenarios like software installation.

  • Shared/CacheModel.cpp:

(WebKit::calculateCacheSizes):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r201856 r201857  
     12016-06-08  Antti Koivisto  <antti@apple.com>
     2
     3        Increase disk cache capacity when there is lots of free space
     4        https://bugs.webkit.org/show_bug.cgi?id=158526
     5
     6        Reviewed by Chris Dumez.
     7
     8        Our maximum disk cache capacity has been 175MB for a very long time. Meanwhile the average resource size has grown
     9        massively. 175MB is now enough for cacheable resources of a few dozen sites at most. Using bigger caches when there is
     10        room for it can reduce network traffic, reduce disk writes, save battery and speed up page loading.
     11
     12        This patch changes cache size for PrimaryWebBrowser cache model
     13
     14        >=16GB free: 175MB -> 500MB
     15        8-16GB free: 150MB -> 250MB
     16
     17        and modestly for DocumentBrowser
     18
     19        >=16GB free: 50MB -> 75MB
     20
     21        Note that if system (on Cocoa platforms) really needs disk space it will wipe out caches so this doesn't reduce
     22        available disk space in scenarios like software installation.
     23
     24        * Shared/CacheModel.cpp:
     25        (WebKit::calculateCacheSizes):
     26
    1272016-06-08  Youenn Fablet  <youenn.fablet@crf.canon.fr>
    228
  • trunk/Source/WebKit2/Shared/CacheModel.cpp

    r197638 r201857  
    5656        urlCacheMemoryCapacity = 0;
    5757
    58         // Foundation disk cache capacity (in bytes)
     58        // Disk cache capacity (in bytes)
    5959        urlCacheDiskCapacity = 0;
    6060
     
    9393            urlCacheMemoryCapacity =      512 * 1024;
    9494
    95         // Foundation disk cache capacity (in bytes)
     95        // Disk cache capacity (in bytes)
    9696        if (diskFreeSize >= 16384)
    97             urlCacheDiskCapacity = 50 * 1024 * 1024;
     97            urlCacheDiskCapacity = 75 * 1024 * 1024;
    9898        else if (diskFreeSize >= 8192)
    9999            urlCacheDiskCapacity = 40 * 1024 * 1024;
     
    154154#endif
    155155
    156         // Foundation disk cache capacity (in bytes)
     156        // Disk cache capacity (in bytes)
    157157        if (diskFreeSize >= 16384)
    158             urlCacheDiskCapacity = 175 * 1024 * 1024;
     158            urlCacheDiskCapacity = 500 * 1024 * 1024;
    159159        else if (diskFreeSize >= 8192)
    160             urlCacheDiskCapacity = 150 * 1024 * 1024;
     160            urlCacheDiskCapacity = 250 * 1024 * 1024;
    161161        else if (diskFreeSize >= 4096)
    162162            urlCacheDiskCapacity = 125 * 1024 * 1024;
Note: See TracChangeset for help on using the changeset viewer.