commit | 26373c7d7c3a2974a1b3aa796eba6af0526ba71b | [log] [tgz] |
---|---|---|
author | Francois Doray <fdoray@chromium.org> | Fri Apr 09 16:15:37 2021 |
committer | Copybara-Service <copybara-worker@google.com> | Fri Apr 09 16:27:08 2021 |
tree | 76001a5bb734a92f8d5406c0698f289bc70c3184 | |
parent | 7a14c10fdd038324ec92de9928e2a03287890bed [diff] |
[net] Use an atomic counter to track received bytes. With this CL, a global atomic counter is used to track bytes received through //net's UDP and TCP sockets. This replaces the previous lock-protected counter in a singleton object managed by LazyInstance. An atomic counter is faster than a lock-protected counter: https://chromeperf.appspot.com/report?sid=82ed117e0b1ef424ee3388019db813d17497700f688268d4cc7ccbbc0c72548c A global avoids the memory barriers introduced by LazyInstance: https://source.chromium.org/chromium/chromium/src/+/master:base/lazy_instance_helpers.h;l=58-95;drc=59b18de9525c94e2ee27748059d110c56aea32e9 We make these performance optimizations in preparation for updating the counter every time bytes are received by UDPSocketPosix, instead of updating on a timer. Bug: 1189805 Change-Id: I8fd5da67f2a086352c60c7f6223d72ad87167d21 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2774071 Commit-Queue: Eric Orth <ericorth@chromium.org> Auto-Submit: François Doray <fdoray@chromium.org> Reviewed-by: Eric Orth <ericorth@chromium.org> Cr-Commit-Position: refs/heads/master@{#870991} GitOrigin-RevId: 8ba18aaba7e6115401f3880827d58f04b94c2c38
This directory contains the code behind Chrome's networking stack. It is documented here.