On Tue, Dec 3, 2013 at 12:58 PM, <
Victor....@ncl.ac.uk> wrote:
> On Monday, 2 December 2013 23:37:50 UTC, Billy O'Neal wrote:
>>
>> Vector is plenty fast and safe. Nobody has shown a serious application
>> where the performance cost of checking size in push_back made any measurable
>> difference in an overall application in an application compiled in release
>> mode.
>
>
>
> You are making a sweeping generalization here. I had a significant
> performance deterioration due to this issue, like 10% for the whole program,
> when I moved from my home-brewed vector-like class to vector. More
> precisely, the innermost loop was a call to std::transform with
> std::back_inserter(vector) as the output range. And it was serious enough
> for me (of course, you're free to choose which applications you consider
> "serious"). I believe that push_back in an innermost loop is quite common,
> although I don't have any statistics to back it up. Another common case
> where vector is VERY slow (for a different reason) is given at the end.
>
>
>>
>> The average programmer is not writing an application where the size check
>> inside push_back is significant enough to make a significant difference in
>> application performance. Vector is designed for the 99.9% case. This
>> proposed optimization is describing an optimization for a 0.01% case.
>>
>
> Confess, you just faked these numbers (they don't even add up to 100% ;-).