![]() |
Blitz Support : |
From: Xavier WARIN(Compte LOCAL) - I23 (xavier.warin_at_[hidden])
Date: 2004-07-15 09:11:40
Hi Olivier
Your options doesn't optimize enough.
Please try -O3 -funroll-loops -fstrict-aliasing
And tell me if it improves. I will take perhaps a long time to compile.
Xavier
Olivier Saut wrote:
> Xavier WARIN(Compte LOCAL) - I23 wrote:
>
>> Hi Olivier,
>
>
> Salut Xavier!
>
>>
>> Which compiler do you use ? on which OS? Which option do you use ?
>
>
> gcc 3.3 on FreeBSD (-current). I don't use -DBZ_DZBEBUG but compile with
> -O2.
>
>> An obvious problem : you always create a new objet D that you fill in
>> and then copy (return D) : that's very slow. You could perhaps create
>> your object outside the class and give a reference to it as an
>> argument :
>> void product(const dipolarMatrix & A, const dipolarMatrix &B,
>> dipolarMatrix & D)
>> Another problem : you'd better write :
>> for(int i=0; i<5; ++i)
>> for(int j=0; j<5; ++j)
>> {
>> complex<double> x =0;
>> for(int p=0; p<5; ++p)
>> x +=A(i,p)*B(p,j);
>> D(i,j) = x ;
>> }
>> I would interested in knowing the improvement with my suggestions
>
>
> Your suggestions result in a 6% speed improvement (which means hours of
> computation time saved). I will try to investigate a little more to find
> bottlenecks as this is probably not related to Blitz++.
>
> Thanks a lot!
> - Olivier
> _______________________________________________
> Blitz-support mailing list
> Blitz-support_at_[hidden]
> http://www.oonumerics.org/mailman/listinfo.cgi/blitz-support
>
>