Dear Riccardo and Allin,
Huge thanks to you all! Your enhancements boosted the performance more than
threefold! See for yourself: performance comparison of the initial version
(AK), Riccardo’s one (RL), Allin’s one (AC) and the final version with the
slight improvement (ACRL); measured in results per second (more = better).
Tested in 5 runs under Windows and Linux (Debian) on a good modern (AMD
FX-6200) and a bad obsolete system (Atom M270).
Perf AK RL AC ACRL
LnxGood 437 1346 2329 2483
WinGood 336 783 967 1026
LnxBad 49 168 347 381
WinBad 43 106 137 146
Might be interesting for you how those extra commands influenced the
performance (extra kudos to Linux).
With great appreciation,
Andreï.
2014-03-12 21:15 GMT+04:00 Allin Cottrell <cottrell(a)wfu.edu>:
On Wed, 12 Mar 2014, Riccardo (Jack) Lucchetti wrote:
> On Wed, 12 Mar 2014, Allin Cottrell wrote:
>
>> This is the fastest version I can come up with on a quick go (if one
>> doesn't mind having the result as a matrix):
>>
>> <hansl>
>> set stopwatch
>> scalar T = 10000
>> matrix y = zeros(T,1)
>> scalar iters=10000
>> matrix DFT = zeros(iters,1)
>>
>> loop i=1..iters --quiet
>> y = cum(mnormal(T, 1))
>> DFT[i] = (T-2) * (mols(y[3:],mlag(y,1)[3:])-1)
>> endloop
>> mwrite(DFT, "DFT.mat")
>> printf "Time taken: %f seconds\n", $stopwatch
>> </hansl>
>
> Slight improvement:
>
> <hansl>
> loop i=1..iters --quiet
> y = cum(mnormal(T, 1))
> DFT[i] = (T-2) * (mols(y[3:],y[2:T-1])-1)
> endloop
> </hansl>
How did I miss that trick ;-)
Allin
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users