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

Issue 965773002: Optimize chained string concatenation in SPDY code.

Created:
5 years, 9 months ago by Daniel Bratell
Modified:
5 years, 8 months ago
Reviewers:
CC:
chromium-reviews, cbentzel+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Optimize chained string concatenation in SPDY code. C++ operator+ for std::string creates temporary strings that have to be constructed and destructed inline. When chaining more than one + those temporary objects makes the code larger and slower than necessary. This shrinks the SPDY code by 1-2% (performance change is smaller). Size data from Linux x64 content_shell: Total change: -2531 bytes -2: (strings) -244: net::GetUrlFromHeaderBlock(std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&, net::SpdyMajorVersion, bool) type=t, (was 1285 bytes, now 1041 bytes) -395: net::SpdyStream::DecreaseRecvWindowSize(int) type=t, (was 969 bytes, now 574 bytes) -917: net::SpdyFramer::WriteHeaderBlockToZ(std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const*, z_stream_s*) const type=t, (was 3913 bytes, now 2996 bytes) -9: net::SpdySession::OnWindowUpdate(unsigned int, unsigned int) type=t, (was 1331 bytes, now 1322 bytes) -143: net::(anonymous namespace)::SpdyHeaderBlockToListValue(std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&, net::NetLog::LogLevel) type=t, (was 520 bytes, now 377 bytes) -367: net::SpdySession::IncreaseSendWindowSize(int) type=t, (was 954 bytes, now 587 bytes) -454: net::SpdySession::DecreaseRecvWindowSize(int) type=t, (was 1177 bytes, now 723 bytes) BUG=

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+36 lines, -31 lines) Patch
M net/spdy/spdy_framer.cc View 1 chunk +5 lines, -9 lines 1 comment Download
M net/spdy/spdy_http_utils.cc View 1 chunk +6 lines, -3 lines 1 comment Download
M net/spdy/spdy_session.cc View 4 chunks +18 lines, -14 lines 1 comment Download
M net/spdy/spdy_stream.cc View 1 chunk +7 lines, -5 lines 1 comment Download

Messages

Total messages: 12 (5 generated)
Bence
Matt, PTAL. Daniel, sorry for not getting back to you earlier. I am unsure what ...
5 years, 9 months ago (2015-03-09 19:53:46 UTC) #3
mmenke
https://codereview.chromium.org/965773002/diff/1/net/spdy/spdy_framer.cc File net/spdy/spdy_framer.cc (right): https://codereview.chromium.org/965773002/diff/1/net/spdy/spdy_framer.cc#newcode1346 net/spdy/spdy_framer.cc:1346: cookie.append(";"); Isn't this the same as: if (i > ...
5 years, 9 months ago (2015-03-09 20:21:59 UTC) #4
Bence
Daniel: I propose https://crrev.com/996483002 instead of your change for spdy_http_utils.cc. Thanks for pointing out the ...
5 years, 9 months ago (2015-03-09 21:00:08 UTC) #5
Daniel Bratell
On 2015/03/09 21:00:08, Bence wrote: > Daniel: I propose https://crrev.com/996483002 instead of your change for ...
5 years, 9 months ago (2015-03-10 10:03:55 UTC) #6
mmenke
Removing myself as a reviewer, to clean up my pending review list. Feel free to ...
5 years, 8 months ago (2015-03-30 15:22:46 UTC) #7
mmenke
On 2015/03/30 15:22:46, mmenke wrote: > Removing myself as a reviewer, to clean up my ...
5 years, 8 months ago (2015-03-30 15:23:22 UTC) #10
Bence
5 years, 8 months ago (2015-03-30 15:28:48 UTC) #12
On 2015/03/30 15:22:46, mmenke wrote:
> Removing myself as a reviewer, to clean up my pending review list.  Feel free
to
> add my back if you pick up this CL again (Removing everything but the
> net/spdy/spdy_http_utils.cc changes?)

Same here: removing myself as a reviewer, feel free to add me back when/if you
update this CL.

Powered by Google App Engine
This is Rietveld 408576698