Why Julia is not faster than Matlab ?

994 views
Skip to first unread message

Lytu

unread,
Jun 12, 2015, 4:01:12 AM6/12/15
to julia...@googlegroups.com
Hello Julia users,

I have a question. Did anyone notice that Julia is less faster than Matlab or it's only me that have noticed this.
Can anyone please tell me why Julia is not as faster as they claim ? Because all the programs that i implement are faster in Matlab than in Julia.

Thank you

Andreas Lobinger

unread,
Jun 12, 2015, 4:25:05 AM6/12/15
to julia...@googlegroups.com
Hello colleague,

you already gave the answer yourself:


Because all the programs that i implement are faster in Matlab than in Julia.

you just need to write faster julia programs (OK, that's not very helpful...).
Although there are fast and slow computers there isn't the equivalent of fast or slow programming languages. Julia isn't a one2one matlab replacement with different speed, it's a completly different approach to write efficient programms. In Matlab a lot of implict computing (and implicit loops) is done by calling library functions (with matrices and other 'big' data fields) while in julia a lot of explicit loops and operations are favoured. See
http://docs.julialang.org/en/release-0.3/manual/noteworthy-differences/ and
http://docs.julialang.org/en/release-0.3/manual/performance-tips/#man-performance-tips

My personal oppinion is (because i'm doing very efficient computing in Matlab) that the Julia = incredible speed is a little bit overhyped. Julia gives you the control to write fast programs, but it cannot do the job for you.

yu...@altern.org

unread,
Jun 12, 2015, 4:26:16 AM6/12/15
to julia...@googlegroups.com
Without a specific example it's hard to say anything. Matlab can be faster for some cases, but Julia should be faster in many cases, if you write your code correctly.

Spencer Russell

unread,
Jun 12, 2015, 11:31:34 AM6/12/15
to julia...@googlegroups.com
There are a bunch of useful tips for making your Julia code faster here:
 
There tends to be a lot of discussion on the list on relative performance between Julia and other languages, and the core team keeps track of performance issues very carefully, so it's definitely not just a case of nobody noticing that Julia is actually slower than Matlab. :)
 
Most likely there are things you can do in your Julia code to speed it up (sometimes by orders of magnitude), though I'm sure there are specific cases where optimized Matlab code could beat out optimized Julia code, or at least where the performance is equivalent.
 
It's also worth noting that often if you take Matlab code that's pretty well-written and port it directly to Julia you'll see worse performance, because the things you do in Julia to make your code fast are different than the things you do in Matlab to make your code fast. Again the performance tips linked above are super helpful.
 
-s

Stefan Karpinski

unread,
Jun 12, 2015, 11:38:27 AM6/12/15
to Julia Users
By far the most likely issue is that you're doing everything in global scope. The next most likely problem is that you have some type stability/predictability issues. And of course, it's always possible that you have code that Matlab is really fast at; for some problems it's not possible to do much better than a well-written vectorized code that leverages fast kernels.

Tim Holy

unread,
Jun 12, 2015, 12:25:08 PM6/12/15
to julia...@googlegroups.com
In particular, if all your code is basically:

C = A*B
U, S, V = svd(C)
result = V'*x

then it's also the case that Julia will not provide any kind of "special"
benefit---Matlab is just as good as Julia at linear algebra and a few other
operations, as both simply call out to other routines for most operations.

Best,
--Tim

colint...@gmail.com

unread,
Jun 13, 2015, 11:53:39 PM6/13/15
to julia...@googlegroups.com
Given the wording of your question, it seems highly likely that you are user4905479 from StackOverflow (see http://stackoverflow.com/questions/30728371/why-julia-is-not-faster-than-matlab). As you were advised there, you will need to post your code if you want to progress your understanding.

Cheers,

Colin
Reply all
Reply to author
Forward
0 new messages