Am 12.02.2018 um 00:28 schrieb Sven Schreiber:
I'd be interested in an analogous solution for Julia in a foreign
block!
OK, responding to myself, since Julia is close enough to Python to get
this done quickly. Attached is an extended version of the JIT tests with
foreign.
Allin, it seems there is a problem in gretl_io.jl in the gretl_export
function. AFAICS 'size(M)' will be empty in Julia for a scalar M, and
therefore the assignment 'r,c = size(M)' fails then. I'm not Julia savvy
enough yet to send a clean solution. (I worked around it by putting the
result into a dummy matrix before calling gretl_export.)
Whether Python or Julia is faster seems to depend on the problem size:
1) With 10^7:
Python / Numba
This took = 0.923493 sec.
mn = 2.7182583
Now Julia
This took = 1.346360 sec.
mn = 2.7183726
2) With 10^8:
Python / Numba
This took = 3.780052 sec.
mn = 2.7182127
Now Julia
This took = 2.689789 sec.
mn = 2.7184079
Apparently the one-time overhead is higher for Julia, and then at some
point it overtakes Python. Very interesting.
cheers,
sven