# Julia slower than Matlab & Python? No

**URL:** <https://discourse.julialang.org/t/julia-slower-than-matlab-python-no/33128>\
**Category:** Performance\
**Tags:** economics, tensorflow, matlab, pytorch\
**Created:** [January 8, 2020, 11:57pm UTC](https://discourse.julialang.org/t/julia-slower-than-matlab-python-no/33128 "2020-01-08T23:57:37Z")\
**Posts on this page:** 1\
**Showing post:** 83

<div class="post-metadata">

**Author:** ![Albert\_Zevelev](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albert_zevelev/32/11844_2.png) [@Albert\_Zevelev](https://discourse.julialang.org/u/Albert_Zevelev)\
**Post date:** [January 17, 2020, 9:05pm UTC](https://discourse.julialang.org/t/julia-slower-than-matlab-python-no/33128/83 "2020-01-17T21:05:07Z")

</div>

@jlperla thanks for the suggestions.

It looks like the authors took vectorized code from Matlab & Numpy, then translated it to Julia & found Julia under-performs.

Using above suggestions, I’ve found if you simply replaced the awkward/complicated vectorized parts of the code w/ simpler/more intuitive loops then Julia outperforms all the other languages except TF & PyTorch (which I don’t have right now).

If I add some of the other suggestions given here, the code becomes harder to read & only ~20% faster.

It’s a miracle that in Julia the simpler, more intuitive, & less bug prone code is also faster than numpy/matlab.

---

_[View the full topic](https://discourse.julialang.org/t/julia-slower-than-matlab-python-no/33128)._
