Boost logo

Ublas :

Subject: Re: [ublas] Overhead of matrix indexing
From: dariomt (dariomt_at_[hidden])
Date: 2012-01-19 11:28:35

Malcolm Reynolds <malcolm.reynolds <at>> writes:

> On Wed, Jan 18, 2012 at 1:21 PM, Oswin Krause
> <Oswin.Krause <at>> wrote:
> > Hi,
> >
> > I can't measure any time differences. both take 0.56s.
> > GCC 4.6.2 used here with "-O3" as optimisation option.
> >
> I think sufficiently smart compilers can convert the code to use a
> single index. GCC 4.2 (still the default compiler for OS X 10.6) is
> unable to optimise this properly even with -O3, so I also see roughly
> a factor of three difference in runtime.. However using LLVM-clang the
> pointer and indexed versions perform the same.

It's good to hear that a good optimizer is able to do the right thing.

I'll try other flags in VS2008 or maybe upgrading to VS2010, but I'm tied to
windows and VS. I might try to send this case to VS support.

Many thanks!