News for hackers. Stuff that matters.
Re:Julia v1.3 by montalbano on Tuesday November 26, 2019 @08:56AM (#21638250)
I switched to Julia from Python due to facing the classic '2-language problem' of scientists. We wanted an easy to use API and good speed.

The main bottleneck was computing the Mittag-Leffler function. First we tried in Python, then we get a ~10x improvement by outsourcing that bit to Fortran. The Julia implementation of the Mittag-Leffler function is comparable to Fortran but writing the entire software package in Julia led to ~5x speedup due to avoiding language interop issues and taking advantage of other Julia-specific benefits.

Re:Julia v1.3 by xenonite on Tuesday November 26, 2019 @09:02AM (#21638307)
So, you obtained a 5x speedup of the whole package compared to the Python version with some Fortran extensions?
Re:Julia v1.3 by montalbano on Tuesday November 26, 2019 @09:41AM (#21638612)
Yes.

And for anyone wondering about the state of the Julia package ecosystem compared to Python, someone had already written the main two packages we needed in Julia (for Mittag-Leffler computation and Inverse Laplace computation). At that time there was no Mittag-Leffler implemented in Python or SciPy that I could find.

I could also add that we were computing integral equations with Mittag-Leffler function in the Kernels so in worst cases we needed O(n^2) calls to Mittag-Leffler function where n could be O(10^5).

Re:Julia v1.3 by Rochus on Tuesday November 26, 2019 @12:00PM (#21640126)
If you need another speedup consider LuaJIT which is used at CERN for heavy number crunching and data analysis, see http://cds.cern.ch/record/2157242?ln=de. E.g. on slide 14: LuaJIT took 5.3 sec, C++/GCC 5.7 sec, PyPy 7.6 sec, Julia 35 sec and Python > 2 hours.
Re:Julia v1.3 by improbable22 on Tuesday November 26, 2019 @12:14PM (#21640277)
From the comments on that:

> No one should use global scope of Julia for calculations: [...] which is said that takes 35 seconds. > If you wrap it in a function and not had a type instability, You'd get 4.704 seconds...

Half-decently written Julia ought not to be much slower than C.

But it does also allow you to write quick and dirty scripts with no care for speed, which is also useful. It would be nice if people wouldn't benchmark the latter. The manual has a pretty helpful section for avoiding this: https://docs.julialang.org/en/v1/manual/performance-tips/

Re:Julia v1.3 by montalbano on Tuesday November 26, 2019 @12:27PM (#21640427)
Indeed, I would imagine that well written Julia is on par with LuaJIT.

Even more importantly, from a cursory look online I cannot find any Lua implementation of either the Mittag-Leffler function or Inverse Laplace routines. And there is no reference to any wider ecosystem of scientific computing packages.

Sure I could call some C functions but then I'm back to facing a 2-language problem which I don't want.

Furthermore, it looks like there has been no new releases of LuaJIT since 2017. Development on it looks to have stopped.

Re:Julia v1.3 by Rochus on Tuesday November 26, 2019 @01:26PM (#21641120)
If you can measure you don't have to imagine.
Re:Julia v1.3 by eigenspace on Tuesday November 26, 2019 @12:40PM (#21640572)
I watched the video, those benchmarks are just terrible. If one wants to use LuaJIT for a porject, sure go for it, but making up weird benchmarks like that which purposefully cripple competitor language performance is just embarrassing.
Re:Julia v1.3 by Rochus on Tuesday November 26, 2019 @01:18PM (#21641036)
Well, weird benchmarks are probably all those where your favorite language doesn't look good ;-)
Re:Julia v1.3 by eigenspace on Tuesday November 26, 2019 @01:35PM (#21641195)
I would say in this case what's 'weird' about the benchmarks is that the optimization strategy taken across the languages is incredibly uneven. Indeed, simply wrapping the above julia code in a `let` block so it's not out in the global scope is sufficient to have it on par with C++ (assuming the same flags are used, e.g. fastmath).