[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.
- [OF miscellaneous] Hilbert curve: recursion faster than loop?, JuanPi, 2017/08/05
- Re: [OF miscellaneous] Hilbert curve: recursion faster than loop?, siko1056, 2017/08/06
- Re: [OF miscellaneous] Hilbert curve: recursion faster than loop?, Juan Pablo Carbajal, 2017/08/07
- Re: [OF miscellaneous] Hilbert curve: recursion faster than loop?, Juan Pablo Carbajal, 2017/08/07
- Re: [OF miscellaneous] Hilbert curve: recursion faster than loop?,
siko1056 <=
- Re: [OF miscellaneous] Hilbert curve: recursion faster than loop?, Juan Pablo Carbajal, 2017/08/07
- Re: [OF miscellaneous] Hilbert curve: recursion faster than loop?, Julien Bect, 2017/08/07
- Re: [OF miscellaneous] Hilbert curve: recursion faster than loop?, siko1056, 2017/08/07
- Re: [OF miscellaneous] Hilbert curve: recursion faster than loop?, Juan Pablo Carbajal, 2017/08/07
- Re: [OF miscellaneous] Hilbert curve: recursion faster than loop?, Juan Pablo Carbajal, 2017/08/07