
13 Jun
2005
13 Jun
'05
10:33 a.m.
Maxim Yegorushkin writes:
For example, I had a router which used a TCP binary protocol. Each message is prefixed with 4 byte length, so I read the 4 bytes, resized a std::vector<char> for the message length, and then read the message into the vector. After profiling the router under heavy load it turned out that 30% of user time was spent in guess where? In zeroing out memory in std::vector<char>::resize(). And you are talking about data copying here...
This reminds me of recent post by Dave Harris: http://lists.boost.org/boost/2005/06/27934.php -- Alexander Nasonov