Boost logo

Ublas :

Subject: Re: [ublas] Overhead of matrix indexing
From: dariomt (dariomt_at_[hidden])
Date: 2012-01-18 04:10:58

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

> On Tue, Jan 17, 2012 at 6:39 PM, <dariomt <at>> wrote:
> > Any hints? Ideas?
> > I've compiled with all possible optimizations I could think of, but pointers
> > always beat matrix indexing.
> I don't know if this will help at all, but have you tried iterators as
> a third option? I'd be intrigued to see the relative timings also (ie
> are pointers 20% faster, or an order of magnitude faster..)

Compiled with VS2008
cl /O2 /Ob2 /Oi /Ot /Oy /I "C:\ThirdPartyLibs\boost\1_42_0" /D "WIN32" /FD /EHa
/MD /GS- /W3 /TP ..\main_2.cpp /Fetest.exe

Measuring runtime with cygwin
$ time ./test.exe

real 0m2.202s
user 0m0.015s
sys 0m0.031s

$ time ./test.exe xx

real 0m0.592s
user 0m0.015s
sys 0m0.030s

That's more than 3 times faster for this case.

I'll try iterators and post results.