|
Boost : |
From: Alexander Nasonov (alnsn-boost_at_[hidden])
Date: 2005-06-13 05:33:39
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
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk