Boost logo

Boost Users :

From: joel falcou (joel.falcou_at_[hidden])
Date: 2008-08-07 14:09:54


> But with a index you need two variables, the base pointer + index.
And
> unless your compiler + instruction set allows you to addess
a memory
> location using a base pointer + index then you are
going to loose much in
> performance. IMHO a pointer is always
faster, it let you write the
> algorithm in a different way
avoiding probably the example you gave above.

Did you do the
actual performances check ?
On decent compiler for non-exotic
architectures the difference is really thin for L1 cache compliant number
of elements.

I have nothing against pointer anyway but good
data structure like Numerical Recipes multi-dimensionnal allocation makes
things easier with a very small overhead.



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net