I have been spending the past weeks trying to really understand how to implement efficient code.

As far as I can tell (from first hand experience), Julia really does give you a prominent edge over R and Matlab in terms of performance. However, I also think that there are currently a lot of ways to shoot yourself in the foot (accidental type instability and memory allocation are the most prominent of those in my experience).

So currently I don't think that Julia allows you to naively write "simple and efficient code", iff you are not used to the language. In my opinion, you really do need to get to know the language before simple code becomes efficient as well.

Given that we are not at version 1.0 yet, I don't mind that at all. I see it like this: If you know what to look out for, the code is usually pretty competitive with C (about a factor of 2 to 3 currently for my code). I rather have the developers focus on improving the potential performance, than on making it "idiot proof" just yet. I think the later is best tackled after the more pressing issues are taken care of.

That being said, I do think one should be careful of how Julia is advertised by word of mouth. The comparison to Matlab, which has a very similar syntax but (I think) a very different way of efficient coding, can be a red herring and give rise to false expectations. I don't think you can currently just copy and paste Matlab code and expect it to be faster.

On 2015-09-24 14:17, Marcio Sales wrote:
Wow. All this discussion to make Julia only /as fast as/ the old scripting languages? I gotta say that worried me a bit. What do you do when there's no code to compare? How will you know that it was really a good idea switching from Matlab/Python to Julia?

Considering what the develops proudly advertize about performance (what I think is why most people would even consider changing to it), shouldn't the language be designed as to put the user in the best performant direction most of the time? Matlab does a good job on that with fewer but simplified and efficient data structures, supporting vectorized code etc. In my short experience with Julia, it seems that there are a lot of ways to do the same thing, some of which very bad in terms of performance, like the original code in this post. If Julia can't be easily faster and less verbose than R for example, we could just forget about it...

Reply via email to