On Thu, 27 Mar 2014, Cottrell, Allin wrote:You shuld also consider the "loop" overhead. Try this:
Having done an experiment I'm actually quite surprised at just how much faster
option 2 is. Here's my test:
<hansl>
set echo off
set messages off
loop i=1..10 --quiet
matrix X$i = mnormal(200,20)
endlooploop 100 --quiet
# option 1
set stopwatch
matrix A = X1 ~ X2 ~ X3 ~ X4 ~ X5 ~ X6 ~ X7 ~ X8 ~ X9 ~ X10
endloop
t0 = $stopwatch
set stopwatch
loop 100 --quiet
matrix A = {}
loop i=1..10 --quiet
A = A ~ X$i
endloop
endloop
t1 = $stopwatch
print t0 t1
</hansl>
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti@univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------
_______________________________________________
Gretl-users mailing list
Gretl-users@lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users