Bug 146354 - Make NetworkCache::traverse faster
Summary: Make NetworkCache::traverse faster
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2015-06-26 11:17 PDT by Antti Koivisto
Modified: 2015-06-27 01:54 PDT (History)
2 users (show)

See Also:

patch (10.53 KB, patch)
2015-06-26 12:00 PDT, Antti Koivisto
andersca: review+
Details | Formatted Diff | Diff
patch (13.40 KB, patch)
2015-06-27 01:38 PDT, Antti Koivisto
no flags 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-06-26 11:17:01 PDT
Currently it reads one file at a time making it slow.
Comment 1 Antti Koivisto 2015-06-26 12:00:26 PDT
Created attachment 255655 [details]
Comment 2 WebKit Commit Bot 2015-06-26 12:02:23 PDT
Attachment 255655 [details] did not pass style-queue:

ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannel.h:51:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannel.h:52:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:91:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:107:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 4 in 5 files

If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Anders Carlsson 2015-06-26 12:05:46 PDT
Comment on attachment 255655 [details]

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

> Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:107
> +void IOChannel::write(size_t offset, const Data& data, WorkQueue* queue, const std::function<void (int error)>& completionHandler)

I don't think this should be a const& since that's an extra copy.

> Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp:704
> +    std::unique_ptr<TraverseOperation> traverseOperationPtr(new TraverseOperation { flags, WTF::move(traverseHandler) });

auto + std::make_unique?
Comment 4 Carlos Garcia Campos 2015-06-27 01:25:21 PDT
Antti, please, consider fixing GTK+ build before landing. You just need to do the same changes in NetworkCacheIOChannelSoup.cpp and include <condition_variable> in NetworkCacheStorage.cpp
Comment 5 Antti Koivisto 2015-06-27 01:38:17 PDT
Created attachment 255698 [details]
Comment 6 WebKit Commit Bot 2015-06-27 01:39:36 PDT
Attachment 255698 [details] did not pass style-queue:

ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp:39:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 1 in 3 files

If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Antti Koivisto 2015-06-27 01:54:23 PDT