4 ms·
In most cases I've come across (signals processing) a trivial Python (NumPy) implementation was much faster than a trivial Julia implementation, because of the
by eliteraspberrie 13y ago
In most cases I've come across (signals processing) a trivial Python (NumPy) implementation was much faster than a trivial Julia implementation, because of the vector syntax. This, IMHO, is the Achilles heel of the Julia language.
Generally speaking, any language for numerical computing must feature vector syntax. Most numerical algorithms work on arrays (vectors, matrices, and so on) and can be easily translated into a language which supports vector notation: MATLAB, Fortran, and Python (NumPy).
Asking people, in 2013, to explicitly write loops in numerical code is a definite step backwards.
- nick_dm 13y agoIs there any thing in particular that Julia is missing here? http://docs.julialang.org/en/release-0.2/manual/arrays/#vectorized-operators-and-functions http://docs.julialang.org/en/release-0.2/manual/arrays/#vect... http://docs.julialang.org/en/release-0.2/manual/linear-algebra/#elementary-operations http://docs.julialang.org/en/release-0.2/manual/linear-algeb... My understanding was that Julia gives you the option to write loops explicitly but it doesn't stop you using vector and matrix operations when appropriate, so I'm curious if there are any particular operations that its array implementation are missing?
- micro2588 13y agoI think this comment is referencing the fact that as of right now, slicing a julia array creates a copy and not a lightweight "view" of the sliced data. This makes vectorized operations on slices of arrays sometimes faster in numpy than in julia. See https://github.com/JuliaLang/julia/issues/3701 https://github.com/JuliaLang/julia/issues/3701.
- StefanKarpinski 13y agoNote that you already can make view slices, it just isn't the default. As per the issue you linked to, the default will change to views in version 0.3.
- StefanKarpinski 13y agoThis is a bizarrely misinformed comment. You can write vectorized code in Julia as much as you want and it's generally as fast as it is in Matlab or NumPy, although there are a few cases where it can be up to 2x slower; we're working on those. The difference is that you can write for loops and those will be as fast as for loops in C. Julia's vectorized code only looks bad in comparison to its for loops – because those are even faster.