|
SimpleCache: open with fewer seeks.
There's usually no reason to read the file header before reading the
stream 0 (headers) data when opening a simple cache entry. By not doing
so, seeks in the critical path of the loading headers are reduced, which
should speed up http caching performance.
To be careful, the headers are still checked when the first read of data
(if any) is performed. This delays detecting hash collisions in the
cache, because the header data is required to compare keys (instead of
just hashes).
To compensate for the later key comparison, a SHA256 of the key is
stored as an optional prefix to the end of file record. This is used to
validate the key is correct before returning headers to the client.
Because the key checking logic is now totally migrated back into the
SimpleSynchronousEntry, we can return to reporting on key matching in
the SyncOpenResult histograms.
R=juliatuttle@chromium.org,asvitkine@chromium.org,rdsmith@chromium.org
BUG= 611732
Review-Url: https://codereview.chromium.org/1977863003
Cr-Commit-Position: refs/heads/master@{#395083}
(cherry picked from commit 9f15f2258d7cae8cd12cb4ef7143ad648a958333)
Committed: https://chromium.googlesource.com/chromium/src/+/3b7225481e277fb9cbaadc6aa37654a59e0457f8
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+561 lines, -231 lines) |
Patch |
 |
M |
net/disk_cache/backend_unittest.cc
|
View
|
|
5 chunks |
+30 lines, -5 lines |
0 comments
|
Download
|
 |
M |
net/disk_cache/entry_unittest.cc
|
View
|
|
7 chunks |
+79 lines, -6 lines |
0 comments
|
Download
|
 |
M |
net/disk_cache/simple/simple_backend_impl.cc
|
View
|
|
2 chunks |
+1 line, -31 lines |
0 comments
|
Download
|
 |
M |
net/disk_cache/simple/simple_entry_format.h
|
View
|
|
2 chunks |
+9 lines, -0 lines |
0 comments
|
Download
|
 |
M |
net/disk_cache/simple/simple_entry_impl.h
|
View
|
|
1 chunk |
+5 lines, -0 lines |
0 comments
|
Download
|
 |
M |
net/disk_cache/simple/simple_entry_impl.cc
|
View
|
|
3 chunks |
+13 lines, -16 lines |
0 comments
|
Download
|
 |
M |
net/disk_cache/simple/simple_synchronous_entry.h
|
View
|
|
10 chunks |
+45 lines, -23 lines |
0 comments
|
Download
|
 |
M |
net/disk_cache/simple/simple_synchronous_entry.cc
|
View
|
|
30 chunks |
+249 lines, -129 lines |
0 comments
|
Download
|
 |
M |
net/disk_cache/simple/simple_test_util.h
|
View
|
|
1 chunk |
+8 lines, -0 lines |
0 comments
|
Download
|
 |
M |
net/disk_cache/simple/simple_test_util.cc
|
View
|
|
2 chunks |
+77 lines, -4 lines |
0 comments
|
Download
|
 |
M |
net/disk_cache/simple/simple_util.h
|
View
|
|
1 chunk |
+8 lines, -4 lines |
0 comments
|
Download
|
 |
M |
net/disk_cache/simple/simple_util.cc
|
View
|
|
1 chunk |
+9 lines, -7 lines |
0 comments
|
Download
|
 |
M |
net/disk_cache/simple/simple_util_unittest.cc
|
View
|
|
3 chunks |
+6 lines, -5 lines |
0 comments
|
Download
|
 |
M |
tools/metrics/histograms/histograms.xml
|
View
|
|
4 chunks |
+22 lines, -1 line |
0 comments
|
Download
|
Total messages: 2 (1 generated)
|