WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
143879
Network Cache: Read resource record and body in parallel
https://bugs.webkit.org/show_bug.cgi?id=143879
Summary
Network Cache: Read resource record and body in parallel
Antti Koivisto
Reported
2015-04-17 05:50:23 PDT
We can lower retrieve latency by fetching in parallel.
Attachments
patch
(18.31 KB, patch)
2015-04-17 06:37 PDT
,
Antti Koivisto
no flags
Details
Formatted Diff
Diff
more thread safety
(18.20 KB, patch)
2015-04-17 07:33 PDT
,
Antti Koivisto
cdumez
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Antti Koivisto
Comment 1
2015-04-17 06:37:46 PDT
Created
attachment 251018
[details]
patch
Antti Koivisto
Comment 2
2015-04-17 07:33:30 PDT
Created
attachment 251023
[details]
more thread safety
Chris Dumez
Comment 3
2015-04-17 09:39:41 PDT
Comment on
attachment 251023
[details]
more thread safety View in context:
https://bugs.webkit.org/attachment.cgi?id=251023&action=review
r=me
> Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp:122 > auto filter = std::make_unique<ContentsFilter>();
Maybe rename this one to recordFilter now that we have another filter?
> Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp:124 > size_t size = 0;
Ditto, I would rename this to recordsSize for clarity as it doesn't account for bodies.
> Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp:189 > bool Storage::mayContain(const Key& key) const
Maybe we can add a mayContainBodyBlob() now? For consistency. Then rename this one to mayContainRecord(). I know it is only used in one place right now but I still like it.
> Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp:421 > +void Storage::dispatchReadOperation(ReadOperation& read)
Not a big fan of 'read' variable name. Maybe something like readOperation would be more readable here.
> Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp:435 > + bool shouldGetBodyBlob = !m_bodyBlobFilter || m_bodyBlobFilter->mayContain(read.key.hash());
I would use a utility function like we do for the records filter already.
Chris Dumez
Comment 4
2015-04-17 09:41:56 PDT
Comment on
attachment 251023
[details]
more thread safety View in context:
https://bugs.webkit.org/attachment.cgi?id=251023&action=review
> Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.h:110 > + std::atomic<unsigned> finishedCount { 0 };
Not sure it is best but maybe we could use 2 booleans instead (e.g. hasReadRecord, hasReadBody). Might be a little more readable than expecting this integer to be 2. Your call.
Antti Koivisto
Comment 5
2015-04-17 10:08:55 PDT
https://trac.webkit.org/r182954
Antti Koivisto
Comment 6
2015-04-17 10:10:04 PDT
(In reply to
comment #4
)
> Not sure it is best but maybe we could use 2 booleans instead (e.g. > hasReadRecord, hasReadBody). Might be a little more readable than expecting > this integer to be 2. Your call.
That's what the first patch had and it is actually difficult to make thread safe.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug