Chromium Code Reviews
DescriptionReplace the existing SpdyHeaderBlock typedef with a class.
SpdyHeaderBlock is currently a map<string, string>. This change replaces the
typedef with a class that
* behaves like a linked_hash_map<StringPiece, StringPiece>, that is, preserves
insertion order,
* and also manages memory containing the header names and values, resulting in
much fewer allocations.
String construction and destruction showed up in the CPU profile under heavy
loads, and this class addresses this performance issue.
This CL includes server change 100829267 by rjshade (for
net/spdy/hpack/hpack_{en,de}coder_test.cc), which changed SpdyHeaderBlock to a
linked_hash_map, thus preserving order. That change was not merged separately
because Chromium's linked_hash_map implementation does not support copy.
This CL also includes server changed 103293205 by birenroy, which introduces
SpdyHeaderBlock class managing large chunks of memory.
This CL also updates a large number of unittests and a small amount of
production code to account for header order being preserved.
BUG=443287
Committed: https://crrev.com/7ecc11208382bf462982af29d1680ee5eba2ded3
Cr-Commit-Position: refs/heads/master@{#351062}
Patch Set 1 #Patch Set 2 : Remove unique_ptr. Use NET_EXPORT right. #Patch Set 3 : Rebase. #Patch Set 4 : Use the right namespace qualifier for scoped_ptr<>. #Patch Set 5 : Add .as_string() in devtools. #Patch Set 6 : Remove yet another occurrence of unique_ptr<>. #Patch Set 7 : Update SpdySMServerTest and quic_simple_client_bin.cc. #Patch Set 8 : Do not use scoped_ptr<> in vector<> because move semantics are not supported yet. #Patch Set 9 : Add ~Storage() to free memory. #Patch Set 10 : Avoid C++11 initializer list. #Patch Set 11 : Change test values to StringPiece. #Patch Set 12 : Rebase. #Patch Set 13 : Adopt QuicSpdyStreamServerTest to the new interface. #Patch Set 14 : Nit. #Patch Set 15 : Add some includes. #
Total comments: 10
Patch Set 16 : Do not use using directive at file level in header file. #Patch Set 17 : Include spdy_test_utils.h in tests for StringPieceProxy comparison operator. #
Total comments: 2
Patch Set 18 : Rebase. #Patch Set 19 : s/typedef/using/g #Patch Set 20 : Add NET_EXPORT to fix compile error on win_chromium_compile_dbg_ng. #Messages
Total messages: 28 (13 generated)
|