|
Re: [Vxl-users] Fast Programming
From: <durucan@we...> - 2004-05-19 11:50
|
Hi all,
after long time I remembered that I wrote this speed Subject.
So I did some speed tests with variable declerations within
loops and outside loops. Unfortunately I am a beginner regarding
vxl and thus a freshman on this point. Well, I used vul.timer e.g.
vul_timer tic;
....
tic.print(vcl_cerr)
I calculated this on a stereo program I wrote myself
which runs around 0.035 sec/frame on VGA images with
ZMCC as correlation function from the vcl package.
So there are a lot of variable declerations and loops.
I must say that I only had the impression that the outside
loop decleration is faster. This is because the vul_timer
speed measurement is not very exact so that I can not give
you an objective value. It has only three digits after zero and
it changes from one calculation to the other.
Best Regards
Emrullah
Peter.Vanroose@... schrieb am 09.03.04 12:30:30:
>
> > Isn't it faster to do the declarations out of the loop, for example
> > instead of
> > for (unsigned p=0;p<np;++p,planeA += pstepA,planeB += pstepB,planeS += pstepS)
> > {
> > const aT* rowA = planeA;
> ...
> > using following technique:
> > unsigned p;
> > const aT* rowA;
> > for ( p=0;p<np;++p,planeA += pstepA,planeB += pstepB,planeS += pstepS)
> > {
> > ...
>
> Modern C++ compilers should implement both ways identically, certainly
> when optimisation is on (but probably also without optimisation).
> I have never tested this, though.
>
>
> -- Peter.
__________________________________________________________________
Zeigen Sie Emotionen mit der WEB.DE Bild-SMS! Das Bild ist gratis,
Sie bezahlen nur den Versand. http://freemail.web.de/?mc=021196
|
| Thread | Author | Date |
|---|---|---|
| Re: [Vxl-users] Fast Programming | <durucan@we...> |