
On Sat, Jan 22, 2011 at 6:18 AM, Domagoj Saric <dsaritz@gmail.com> wrote:
"Thorsten Ottosen" <nesotto@cs.aau.dk> wrote in message news:4D331E6A.2030907@cs.aau.dk...
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... ...so 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. http://www.revergestudios.com/reblog/index.php?n=ReCode