help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [OF miscellaneous] Hilbert curve: recursion faster than loop?


From: siko1056
Subject: Re: [OF miscellaneous] Hilbert curve: recursion faster than loop?
Date: Mon, 7 Aug 2017 00:14:46 -0700 (PDT)

Juan Pablo Carbajal-2 wrote
>> Yes, one algorithm takes the size of the matrix the other just the order
>> for the recursive one you need to pass 2^n, for the non-recursive ones
>> just n.
> I am sorry, this wasn't clear from my post.

No problem, that problem would have been too obvious ;-) Now I can reproduce
your problem. My next thought was, that the complex computation lowers the
performance and replaced all complex computations by meaningless pure real
ones. Still this version is by factor 2 slower than the recursive one and
with memory allocation by factor 10! So my guess is, that recursion for this
example is faster than repetitive memory allocation within for-loops or the
many data copy operations between z and zz, where also growing implicit
memory allocations might happen as zz changes it's size depending on
z(1:nz(k)) within a for-loop?

Kai



--
View this message in context: 
http://octave.1599824.n4.nabble.com/OF-miscellaneous-Hilbert-curve-recursion-faster-than-loop-tp4684339p4684357.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]