DescriptionOptimize 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
Messages
Total messages: 12 (5 generated)
|