[WebSocket] Avoid frequent buffer deallocation
Tracing suggests WTF::Partitions::FastFree is slow. On my workstation deallocating 260 segments takes more than 100us. This CL stops using SharedBuffer and introduces WebSocketMessageChunkAccumulator which pools segments. A WebSocketMessageChunkAccumulator will free segments which were not used in the last 100ms. This improves [1] in my environment. Without the change: 390MB/s With the change : 416MB/s With --websocket-renderer-receive-quota-max=128000 --websocket-read-buffer-size=32000, the result is Without the change: 494MB/s With the change : 563MB/s 1: third_party/blink/perf_tests/websocket/receive-arraybuffer-1MBx100.html Bug: 865001 Change-Id: Id87134e766b662816249b4a08e24cf844bb4a88f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1725351 Commit-Queue: Yutaka Hirano <yhirano@chromium.org> Reviewed-by:Kentaro Hara <haraken@chromium.org> Reviewed-by:
Adam Rice <ricea@chromium.org> Cr-Commit-Position: refs/heads/master@{#689421}
Showing
Please register or sign in to comment