On Thu, May 12, 2016 at 7:41 AM, Keno Fischer <[email protected]> wrote:
> There seems to be a myth going around that vectorized code in Julia is > slow. That's not really the case. Often times it's just that > devectorized code is faster because one can manually perform > operations such as loop fusion, which the compiler cannot currently > reason about (and most C compilers can't either). In some other > languages those benefits get drowned out by language overhead, but in > julia those kinds of constructs are generally fast. The cases where > julia can be slower is when there is excessive memory allocation in a > tight inner loop, but those cases can usually be rewritten fairly > easily without losing the vectorized look of the code. This. JMW's blog post on the subject is as relevant as when he wrote it: http://www.johnmyleswhite.com/notebook/2013/12/22/the-relationship-between-vectorized-and-devectorized-code/ Conclusion: - *Julia’s vectorized code is 2x faster than R’s vectorized code* - Julia’s devectorized code is 140x faster than R’s vectorized code - Julia’s devectorized code is 1350x faster than R’s devectorized code Julia's vectorized code is not slow – it's faster than other languages. It's just that Julia allows you to write even faster code when it matters.
