-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge bitcoin/bitcoin#31164: net: Use actual memory size in receive b…
…uffer accounting d22a234 net: Use actual memory size in receive buffer accounting (laanwj) 047b5e2 streams: add DataStream::GetMemoryUsage (laanwj) c3a6722 net: Use DynamicUsage(m_type) in CSerializedNetMsg::GetMemoryUsage (laanwj) c6594c0 memusage: Add DynamicUsage for std::string (laanwj) 7596282 memusage: Allow counting usage of vectors with different allocators (laanwj) Pull request description: Add a method `CNetMessage::GetMemoryUsage` and use this for accounting of the size of the process receive queue instead of the raw message size (like we already do for the send buffer and `CSerializedNetMsg`). This ensures that allocation and deserialization overhead is better taken into account. On average, this counts about ~100 extra bytes per packet on x86_64: ``` 2024-10-27T09:50:12Z [net] 24 bytes -> 112 bytes 2024-10-27T10:36:37Z [net] 61 bytes -> 176 bytes 2024-10-27T10:36:38Z [net] 1285 bytes -> 1392 bytes 2024-10-27T09:50:21Z [net] 43057 bytes -> 43168 bytes ``` ACKs for top commit: l0rinc: ACK d22a234 achow101: ACK d22a234 i-am-yuvi: ACK d22a234 danielabrozzoni: Light ACK d22a234 - code looks good to me, but I'm not very familiar with C++ memory management specifics Tree-SHA512: ef09707e77b67bdbc48e9464133e4fccfa5c05051c1022e81ad84f20ed41db83ac5a9b109ebdb8d38f70785c03c5d6bfe51d32dc133d49e52d1e6225f6f8e292
- Loading branch information
Showing
5 changed files
with
36 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters