Boost logo

Boost :

Subject: Re: [boost] Stack-based vector container
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2011-01-22 15:57:19

On Sat, Jan 22, 2011 at 6:18 AM, Domagoj Saric <dsaritz_at_[hidden]> wrote:
> "Thorsten Ottosen" <nesotto_at_[hidden]> wrote in message
>> Den 16-01-2011 16:13, Domagoj Saric skrev:
>>> Could you possibly add a policy that would 'produce' a strictly static
>>> buffer, i.e. that does not use/expand into the heap (to avoid the
>>> overhead described in the response to David Bergman)...
>> Maybe. I guess it takes some measurement to see if it is actually needed.
> Why should we need to measure?
> - It is a priori known that overhead exists: containing and maintaining two
> extra pointers/size_ts, extra indirection for buffer access through a
> pointer on the stack (as opposed to 'direct' access to a buffer on the
> stack), 'possible' EH...
> - The primary, if not the sole purpose of this library is performance...
> ignoring performance issues known in advance would be self/goal
> contradicting and a case of premature pessimization (as pretty much most of,
> so frequently encountered, 'invocations' of the 'root of all evil' rule
> are)...

The performance benefits remain theoretical until measured and, in
theory, a "stack-based" vector is not needed because std::vector is
allowed to be stack-based when possible.

Emil Dotchevski
Reverge Studios, Inc.

Boost list run by bdawes at, gregod at, cpdaniel at, john at