List:MySQL++« Previous MessageNext Message »
From:Jonathan Wakely Date:March 23 2011 2:33pm
Subject:Re: growth behavior of std::vector
View as plain text  
On 23 March 2011 14:13, Tomalak Geret'kal wrote:
> On 23/03/2011 14:11, Warren Young wrote:
> [snip]
>>
>> If you are wrong and your vector implementation's growth
>> strategy is the common 2x one, you have only one
>> reallocation and copy unless you are wrong by a factor of 2
>> * (1 + fudge_factor). If the fudge factor is 10%, that means
>> you have to underestimate the number of returned records by
>> more than 220% to get two or more reallocations and copies.
>>
>
> This notion of "common" is still up for debate.
>
> MSVS uses 1.5x; GCC uses 2x. I'd say that's about half and half, until
> people seriously start using comeau, clang or ICC in production.

It's a property or the standard library, not compiler.  Comeau and ICC
don't have their own standard library, they generally use the native
one from MSVC (i.e. Dinkumware) or GCC.

Dinkumware: 1.5
GCC: 2
RW/Apache stdcxx: 1.618
STLport:  2

I don't know what Clang's stdc++ use, but there's definitely variation
between implementations.
Thread
StoreQueryResults destructor runs without end...Paul Dalach22 Mar
Re: StoreQueryResults destructor runs without end...Dino Korah22 Mar
  • Re: StoreQueryResults destructor runs without end...Paul Dalach23 Mar
    • Re: StoreQueryResults destructor runs without end...Warren Young23 Mar
      • Re: StoreQueryResults destructor runs without end...Warren Young23 Mar
        • Re: StoreQueryResults destructor runs without end...Tomalak Geret'kal23 Mar
          • Re: StoreQueryResults destructor runs without end...Mickael Wolff23 Mar
            • Re: StoreQueryResults destructor runs without end...Tomalak Geret'kal23 Mar
              • Re: StoreQueryResults destructor runs without end...Mickael Wolff23 Mar
                • Re: StoreQueryResults destructor runs without end...Tomalak Geret'kal23 Mar
          • Re: StoreQueryResults destructor runs without end...Warren Young23 Mar
            • Re: StoreQueryResults destructor runs without end...Tomalak Geret'kal23 Mar
              • List etiquette - please use good email subjects :)Joel Fielder23 Mar
                • Re: List etiquette - please use good email subjects :)Tomalak Geret'kal23 Mar
                  • Re: List etiquette - please use good email subjects :)Paul Dalach23 Mar
                    • Re: List etiquette - please use good email subjects :)Dino Korah23 Mar
                      • Re: StoreQueryResults destructor runs without end...Paul Dalach23 Mar
                      • Re: StoreQueryResults destructor runs without end...F.N. Bruggeman23 Mar
                    • Re: List etiquette - please use good email subjects :)Joel Fielder23 Mar
              • Re: growth behavior of std::vectorWarren Young23 Mar
                • Re: growth behavior of std::vectorTomalak Geret'kal23 Mar
                  • Re: growth behavior of std::vectorJonathan Wakely23 Mar
                    • Re: (OT) growth behavior of std::vectorTomalak Geret'kal23 Mar
                      • Re: (OT) growth behavior of std::vectorJonathan Wakely23 Mar
                • Re: (OT) growth behavior of std::vectorTomalak Geret'kal23 Mar
            • Re: StoreQueryResults destructor runs without end...Tomalak Geret'kal23 Mar
              • re: (OT) growth behaviour of std::vector [was Re: StoreQueryResultsdestructor runs without end...]Tomalak Geret'kal23 Mar
        • Re: StoreQueryResults destructor runs without end...Warren Young23 Mar
Re: StoreQueryResults destructor runs without end...Dino Korah23 Mar