• Ben Kelly's avatar
    SimpleCache: Avoid unnecessary index writes in APP_CACHE mode. · 8a7e9620
    Ben Kelly authored
    When a simple disk_cache is in APP_CACHE mode eviction is disabled and
    access times do not need to be tracked.  This means that it should be
    possible to perform read-only operations without triggering any index
    disk writes.
    
    This CL implements this optimization by making the following changes:
    
    * Avoid updating access times in APP_CACHE mode.
    * Avoid writing a clean index to disk when closing the backend.
    * Avoid dirtying the index when a size update does not make a change.
    * Avoid dirtying the index when opening an entry that is in the index.
    * Avoid dirtying the index when dooming an entry not in the index.
    
    With these changes its possible to use simple disk_cache to perform
    read-only operations in cache_storage without any index writes.
    
    Bug: 905351
    Change-Id: I8eed0a72ed166e7b1b3623a7f4c17f7cec7f96d4
    Reviewed-on: https://chromium-review.googlesource.com/c/1351539
    Commit-Queue: Ben Kelly <wanderview@chromium.org>
    Reviewed-by: default avatarMaks Orlovich <morlovich@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#612934}
    8a7e9620
simple_backend_impl.cc 33.7 KB