On Sat, 10 Feb 2018, Artur Tarassow wrote:
Dear all,
I just stumbled about this Julia post
https://www.juliabloggers.com/when-julia-is-faster-than-c/
and translated the code to hansl. Running the original Julia code on my
machine with 10^7 iterations takes about 0.19 seconds. Running the hansl code
below takes about 19 seconds which is 100 times slower compared to Julia. I
am pretty sure there is a much more efficient way to set this up this up
using gretl+hansl (Jack? :-D ) -- but this is not my point. Let's just assume
the average user would set up things as simple as possible.
I am just curious to know at which point Julia makes it seemingly better
compared to C and hansl? Any ideas? Btw, I can't see that Julia makes any use
of parallelization -- according to CPU information only a single core is
fully used. The same holds for gretl.
IMHO, this is one of the cases when teh JIT approach gives a huge
performance boost; if you try the attached script, you'll see gretl is not
bad at all, versus Octave and R. On my machine, I get:
<output>
gretl took 1.454405 sec.
2.718006
Octave took 11.453040 sec.
mn = 2.7172
[1] "R took 2.894000 sec."
[1] 2.717963
</output>
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------