Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In my experience, the big "problem" with Julia's performance is that while it's actually a compiled language, it's also dynamic.

In most compiled languages, if you write code the compiler can't completely infer, it just won't compile. Conversely, once your program compiles, you don't have to worry about the compiler anymore when running the binary - you know your program is compiled effectively.

A Julia program, on the other hand, will run just fine if the compiler can't figure out the types at compile time. It will just infer whatever it can, run that, and then use runtime values when it needs to. That's a big plus for people like me where performance doesn't matter 95% of the time, but it's a bit of a performance trap for newbies.

Almost all cases of people complaining about Julia being slow come from them inadvertantly writing code the compiler can't infer properly. Luckily, Julia has interactive tools to check the inference of functions. In my experience, once you get used to writing Julia, it's rare that you accidentally write non-inferrable code.



Yeah, I think type instability is definitely the biggest culprit when someone's ported over some Python or Matlab code for the first time and isn't getting as much of a speedup as expected. It isn't hard to fix, you just have to know about it (and how to check for it with `@code_warntype`).

That and perhaps the excess unnecessary allocations from array indexing on the right hand side of an assignment, if you don't know about `view`s.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: