Boost logo

Boost :

Subject: Re: [boost] [review] The review of Boost.DoubleEnded starts today: September 21 - September 30
From: Howard Hinnant (howard.hinnant_at_[hidden])
Date: 2017-09-28 12:06:25


> On Sep 28, 2017, at 4:49 AM, Thorsten Ottosen via Boost <boost_at_[hidden]> wrote:
>
> Den 27-09-2017 kl. 23:06 skrev Ion Gaztañaga via Boost:
>> On 26/09/2017 22:03, Joaquin M López Muñoz via Boost wrote:
>>> 4. Same goes for the growing policy. Not even boost::container::vector features a growing
>>> policy, which seems an indication that this is not a heavily demanded customization point.
>> True. But is on my todo list I was recently trying to add customization options to Boost.Container containers (I need to offer something different to my fans that the standard containers can't offer ;-).
>
> We do need some general agreement about what a boost library can do and not do. There is a large difference between saying "I'm not going to use this" or "I don't see the benefit" and saying "I want to prohibit legitimate use cases for other people".
>
>> Usually the choice is usually between a factor of 2 and 1.5. The theoretical limit value for the growth factor to be able to reuse previously allocated memory is roughly 1.61. Howard Hinnant shared with my a nice paper about this more than ten years ago showing how to grow using a factor of 1.6 and the math behind this. I just reviewed that brief paper recently, and since it's not longer online, Howard kindly has given me permission to share it with the Boost community.
>
> Thanks for sharing this.
>
> There is another argument for 1.5 and that is that the casual users ends up with only about 16% wasted space on average compared to 25%.
>
> Reading through the argument, there are a few things I don't get.
> Is seems that the proof sort of assumes one container instance. And will the heap manager actually coalesce anything?

Good questions, and to put this into perspective: When I wrote the CodeWarrior vector I used this argument to use a growth factor of 1.6. But several years later, when I wrote libc++, I went back to 2.

Howard




Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk