socket_stream of Chromium buffers send data up to 32KiB (exact) bytes. However, SocketStreamHandleInternal::send() method keeps in-flight send data not greater than m_maxPendingSendAllowed - 1 that is 32KiB - 1. This means that SocketStreamHandleInternal consumes the buffered data in SocketStreamHandleBase by 32KiB - 1. It makes memory copy operations unaligned unnecessarily. An experiment using the benchmark tool of pywebsocket and emulated 10ms RTT ($ sudo tc qdisc add dev lo root netem delay 10ms) showed this change improves send performance to ~3 times of current. Message| size | After Before KiB | (kB/s) (kB/s) -------+---------------------------------- 10 |50171.485 21000.82 50 |63327.149 22520.343 100 |61798.431 22664.896 500 |67949.569 23572.744 1000 |68817.204 23858.341 5000 |68817.204 23836.127 10000 |64160.401 23437.858 50000 |59362.319 22314.23 100000 |59918.081 23852.784
Created attachment 195075 [details] Patch
Comment on attachment 195075 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=195075&action=review I agree with this change. > Source/WebCore/platform/network/chromium/SocketStreamHandle.cpp:80 > if (m_pendingAmountSent + len >= m_maxPendingSendAllowed) Nits: Now, this condition can be '>' instead of '>='.
+tkent for sanctifying to land this change.
Created attachment 195212 [details] Patch
Thanks for review, Takashi. (In reply to comment #2) > Nits: Now, this condition can be '>' instead of '>='. done
Comment on attachment 195212 [details] Patch Looks ok
Comment on attachment 195212 [details] Patch Clearing flags on attachment: 195212 Committed r146965: <http://trac.webkit.org/changeset/146965>
All reviewed patches have been landed. Closing bug.