Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(457)

Issue 2968453002: Eliminate copying of data in iOS protocol handler to improve performance (Closed)

Created:
3 years, 5 months ago by kapishnikov
Modified:
3 years, 5 months ago
Reviewers:
droger, mef
CC:
chromium-reviews, cbentzel+watch_chromium.org, ios-reviews_chromium.org, net-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Eliminate copying of data in iOS protocol handler to improve performance This change: 1. Eliminates data copying between URLRequest and the NSURLSession client buffers. 2. Dynamically changes the size of the read buffer based on the size of previously read data. 3. Account for the case when [NSInputStream:read] returns -1, that indicates an error. Some internal profiling tests show approx 2% overall network thread improvement with this change. BUG=724546 Review-Url: https://codereview.chromium.org/2968453002 Cr-Commit-Position: refs/heads/master@{#483705} Committed: https://chromium.googlesource.com/chromium/src/+/4bca026aca0b992f6cad31d794db2102ac7c353e

Patch Set 1 #

Total comments: 6

Patch Set 2 : Addressed comments #

Patch Set 3 : More static_casts #

Total comments: 6

Patch Set 4 : Addressed comments #

Patch Set 5 : Changed ERR_UNEXPECTED to ERR_FAILED #

Total comments: 2

Patch Set 6 : Comment fixes. #

Total comments: 2

Patch Set 7 : Changed operator 'new' to 'malloc' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+59 lines, -38 lines) Patch
M ios/net/crn_http_protocol_handler.mm View 1 2 3 4 5 6 9 chunks +59 lines, -38 lines 0 comments Download

Messages

Total messages: 19 (6 generated)
kapishnikov
These are some iOS protocol handler optimizations. PTAL.
3 years, 5 months ago (2017-06-29 15:50:00 UTC) #2
mef
looks pretty good. I agree that POST optimizations deserve separate CL. https://codereview.chromium.org/2968453002/diff/1/ios/net/crn_http_protocol_handler.mm File ios/net/crn_http_protocol_handler.mm (right): ...
3 years, 5 months ago (2017-06-29 16:18:38 UTC) #3
sdefresne
https://codereview.chromium.org/2968453002/diff/1/ios/net/crn_http_protocol_handler.mm File ios/net/crn_http_protocol_handler.mm (right): https://codereview.chromium.org/2968453002/diff/1/ios/net/crn_http_protocol_handler.mm#newcode263 ios/net/crn_http_protocol_handler.mm:263: length = [(NSInputStream*)stream drive-by: style guide bans casts using ...
3 years, 5 months ago (2017-06-29 16:32:53 UTC) #4
kapishnikov
Thanks for the review comment. https://codereview.chromium.org/2968453002/diff/1/ios/net/crn_http_protocol_handler.mm File ios/net/crn_http_protocol_handler.mm (right): https://codereview.chromium.org/2968453002/diff/1/ios/net/crn_http_protocol_handler.mm#newcode263 ios/net/crn_http_protocol_handler.mm:263: length = [(NSInputStream*)stream On ...
3 years, 5 months ago (2017-06-29 19:40:11 UTC) #6
mef
https://codereview.chromium.org/2968453002/diff/40001/ios/net/crn_http_protocol_handler.mm File ios/net/crn_http_protocol_handler.mm (right): https://codereview.chromium.org/2968453002/diff/40001/ios/net/crn_http_protocol_handler.mm#newcode272 ios/net/crn_http_protocol_handler.mm:272: StopRequestWithError(stream.streamError.code, ERR_UNEXPECTED); nit: I'd argue that this is ERR_FAILED, ...
3 years, 5 months ago (2017-06-29 20:52:55 UTC) #7
kapishnikov
https://codereview.chromium.org/2968453002/diff/40001/ios/net/crn_http_protocol_handler.mm File ios/net/crn_http_protocol_handler.mm (right): https://codereview.chromium.org/2968453002/diff/40001/ios/net/crn_http_protocol_handler.mm#newcode272 ios/net/crn_http_protocol_handler.mm:272: StopRequestWithError(stream.streamError.code, ERR_UNEXPECTED); On 2017/06/29 20:52:55, mef wrote: > nit: ...
3 years, 5 months ago (2017-06-29 21:44:02 UTC) #8
mef
lgtm https://codereview.chromium.org/2968453002/diff/80001/ios/net/crn_http_protocol_handler.mm File ios/net/crn_http_protocol_handler.mm (right): https://codereview.chromium.org/2968453002/diff/80001/ios/net/crn_http_protocol_handler.mm#newcode540 ios/net/crn_http_protocol_handler.mm:540: // The NSData will take the ownership of ...
3 years, 5 months ago (2017-06-29 22:14:08 UTC) #9
kapishnikov
https://codereview.chromium.org/2968453002/diff/80001/ios/net/crn_http_protocol_handler.mm File ios/net/crn_http_protocol_handler.mm (right): https://codereview.chromium.org/2968453002/diff/80001/ios/net/crn_http_protocol_handler.mm#newcode540 ios/net/crn_http_protocol_handler.mm:540: // The NSData will take the ownership of |buffer_|. ...
3 years, 5 months ago (2017-06-30 01:06:59 UTC) #10
droger
lgtm https://codereview.chromium.org/2968453002/diff/100001/ios/net/crn_http_protocol_handler.mm File ios/net/crn_http_protocol_handler.mm (right): https://codereview.chromium.org/2968453002/diff/100001/ios/net/crn_http_protocol_handler.mm#newcode581 ios/net/crn_http_protocol_handler.mm:581: read_buffer_.reset(new char[read_buffer_size_]); The doc of dataWithBytesNoCopy specifies that ...
3 years, 5 months ago (2017-06-30 13:07:09 UTC) #11
kapishnikov
https://codereview.chromium.org/2968453002/diff/100001/ios/net/crn_http_protocol_handler.mm File ios/net/crn_http_protocol_handler.mm (right): https://codereview.chromium.org/2968453002/diff/100001/ios/net/crn_http_protocol_handler.mm#newcode581 ios/net/crn_http_protocol_handler.mm:581: read_buffer_.reset(new char[read_buffer_size_]); On 2017/06/30 13:07:09, droger wrote: > The ...
3 years, 5 months ago (2017-06-30 13:25:37 UTC) #12
kapishnikov
On 2017/06/30 13:25:37, kapishnikov wrote: > https://codereview.chromium.org/2968453002/diff/100001/ios/net/crn_http_protocol_handler.mm > File ios/net/crn_http_protocol_handler.mm (right): > > https://codereview.chromium.org/2968453002/diff/100001/ios/net/crn_http_protocol_handler.mm#newcode581 > ...
3 years, 5 months ago (2017-06-30 14:30:18 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2968453002/120001
3 years, 5 months ago (2017-06-30 14:47:54 UTC) #16
commit-bot: I haz the power
3 years, 5 months ago (2017-06-30 15:02:17 UTC) #19
Message was sent while issue was closed.
Committed patchset #7 (id:120001) as
https://chromium.googlesource.com/chromium/src/+/4bca026aca0b992f6cad31d794db...

Powered by Google App Engine
This is Rietveld 408576698