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

Issue 2939993002: Simplify OnReadCompleted() logic that appends bytes to the client buffer (Closed)

Created:
3 years, 6 months ago by kapishnikov
Modified:
3 years, 6 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

Calling [NSMutableData increaseLengthBy:bytes_read] increases the NSMutableData length and fills the newly allocated memory with zeros. According to profiling, filling with zeros may take approximately 1.4% of the total network thread CPU utilization. Instead of growing the buffer, call [NSMutableData appendBytes...], which grows the buffer and copies the data in one step. Unfortunately, there are no performance benefits in doing so, because the underlying implementation uses memmove(), which is less efficient than memcpy(); however, the change simplifies the code. BUG=724546 Review-Url: https://codereview.chromium.org/2939993002 Cr-Commit-Position: refs/heads/master@{#480455} Committed: https://chromium.googlesource.com/chromium/src/+/f471163c1112a5ed7685ac2d1f911c922cb08aa0

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -4 lines) Patch
M ios/net/crn_http_protocol_handler.mm View 1 chunk +1 line, -4 lines 0 comments Download

Messages

Total messages: 13 (6 generated)
kapishnikov
PTAL! This should improve the performance and simplify the code a little.
3 years, 6 months ago (2017-06-14 22:29:35 UTC) #2
kapishnikov
On 2017/06/14 22:29:35, kapishnikov wrote: > PTAL! This should improve the performance and simplify the ...
3 years, 6 months ago (2017-06-14 23:03:00 UTC) #3
mef
lgtm, although it is unfortunate that it doesn't save any CPU.
3 years, 6 months ago (2017-06-15 15:29:08 UTC) #4
droger
lgtm Can you update the CL description if it is incorrect w.r.t. preformance improvements?
3 years, 6 months ago (2017-06-19 08:45:30 UTC) #5
kapishnikov
On 2017/06/19 08:45:30, droger wrote: > lgtm > > Can you update the CL description ...
3 years, 6 months ago (2017-06-19 15:39:24 UTC) #8
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/2939993002/1
3 years, 6 months ago (2017-06-19 15:39:50 UTC) #10
commit-bot: I haz the power
3 years, 6 months ago (2017-06-19 15:59:49 UTC) #13
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://chromium.googlesource.com/chromium/src/+/f471163c1112a5ed7685ac2d1f91...

Powered by Google App Engine
This is Rietveld 408576698