Bug 143783 - Network Cache: Inline small body data to record file
Summary: Network Cache: Inline small body data to record file
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-04-15 10:27 PDT by Antti Koivisto
Modified: 2015-04-18 07:20 PDT (History)
3 users (show)

See Also:


Attachments
patch (16.96 KB, patch)
2015-04-15 10:58 PDT, Antti Koivisto
cdumez: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Koivisto 2015-04-15 10:27:01 PDT
We currently save all body data as separate files. We can improve space efficiency and do less reads by inlining smaller resources.
Comment 1 Antti Koivisto 2015-04-15 10:58:48 PDT
Created attachment 250824 [details]
patch
Comment 2 WebKit Commit Bot 2015-04-15 11:00:13 PDT
Attachment 250824 [details] did not pass style-queue:


ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannel.h:47:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannel.h:48:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannel.h:49:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:82:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:99:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:109:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 6 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Pratik Solanki 2015-04-15 11:04:23 PDT
Comment on attachment 250824 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=250824&action=review

> Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp:497
> +    const size_t maximumInlineBodySize = 16 << 10;

Not sure what the preferred style is but writing this as 16 * 1024 would be clearer to me than the bitshift.
Comment 4 Chris Dumez 2015-04-15 12:29:14 PDT
Comment on attachment 250824 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=250824&action=review

r=me

> Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp:349
> +        return { };

Slight preference for "return Nullopt;"

>> Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp:497
>> +    const size_t maximumInlineBodySize = 16 << 10;
> 
> Not sure what the preferred style is but writing this as 16 * 1024 would be clearer to me than the bitshift.

I agree with Pratik here.

> Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp:516
> +        bool storeAsBlob = shouldStoreBodyAsBlob(write.record.body);

shouldStoreAsBlob as per our boolean variable naming coding style?
Comment 5 Antti Koivisto 2015-04-15 12:56:39 PDT
https://trac.webkit.org/r182856
Comment 6 David Kilzer (:ddkilzer) 2015-04-18 07:20:50 PDT
<rdar://problem/20578464>