Boost logo

Boost :

From: David B. Held (dheld_at_[hidden])
Date: 2002-08-09 11:41:44

"Philippe A. Bouchard" <philippeb_at_[hidden]> wrote in message
> [...]
> - the indexing followed by an addition is negligeable because the
> pointer usage already slows down member accesses;

How about indexing, addition, and *conditional branch*? That appears
in your latest code, and rightly so. I fully expect a branch to have a
noticeable effect on high-volume dereferences.

> - sort() may not have been the best example but creating, copying
> and destroying a container of pointers + number of pointed object
> allocations are the ones that will determine of your program is slow
> or not;

In my applications, creating and destroying a container of pointers are
basically one-time or infrequent operations. Manipulation (copying)
is more frequent, but still not nearly as frequent as access (dereference).

> - length of the containers will always be half size also; you've just
> *doubled* your free memory;

In cases where memory is a concern, I use an intrusive pointer (but
I realize that is not always possible). Also, intrusive pointers are
very fast (faster than your pointer, even).

> - benchmarking them will simply constitute the best proof.

Agreed. And the benchmarks you have provided suffer from the most
obvious criticism of benchmarks in general: they do not reflect common

> [...]
> - There is nothing defined related to alignments in the standards I
> supposed?

I'm not a language lawyer, so I can't really help you there. ;)


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