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: Julien Bect
Subject: Re: [OF miscellaneous] Hilbert curve: recursion faster than loop?
Date: Mon, 7 Aug 2017 11:58:58 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

Le 07/08/2017 à 11:07, Juan Pablo Carbajal a écrit :
for i=1:100; tic; hilbert_curve_nr(9,true); t(i)=toc; end; [mean(t) std(t)]
ans =

    0.0088032   0.0024393

Still this is slower than without allocation

for i=1:100; tic; hilbert_curve_nr(9,false); t(i)=toc; end; [mean(t) std(t)]
ans =

    0.0065030   0.0018694

and both are slower than the recursion (using dev version of miscellaneous [2])

for i=1:100; tic; hilbert_curve(2^9); t(i)=toc; end; [mean(t) std(t)]
ans =

    1.9476e-03   8.0688e-04

[...]

(sadly I have not access to matlab to check)

Octave 4.0.1

7.34 ms [0.11 ms]
4.73 ms [0.06 ms]
1.27 ms [0.03 ms]

Octave 4.3.0+

7.61 ms [0.16 ms]
4.82 ms [0.05 ms]
1.42 ms [0.03 ms]

Matlab R2016b

8.65 ms [0.58 ms]
2.98 ms [0.10 ms]
1.30 ms [0.08 ms]




reply via email to

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