# Compilation of tips for speeding up computations

**URL:** <https://discourse.julialang.org/t/compilation-of-tips-for-speeding-up-computations/45033>\
**Category:** Performance\
**Tags:** question, proposal\
**Created:** [August 16, 2020, 9:57am UTC](https://discourse.julialang.org/t/compilation-of-tips-for-speeding-up-computations/45033 "2020-08-16T09:57:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![amrods](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amrods/32/2543_2.png) [@amrods](https://discourse.julialang.org/u/amrods)\
**Post date:** [August 16, 2020, 9:57am UTC](https://discourse.julialang.org/t/compilation-of-tips-for-speeding-up-computations/45033/1 "2020-08-16T09:57:53Z")

</div>

Every now and then someone posts a question asking about why Matlab/Python/C/Fortran is so much faster than Julia. The great community here is quickly to point out optimizations that can be used which result in a significant improvement to the performance of Julia.

Most of the time, the OP is referred to the [tips in the manual](https://docs.julialang.org/en/v1/manual/performance-tips/), but some other times further optimizations using other packages are suggested (for example using `LoopVectorizations`).

That had me wondering whether there exists a compilation of tips and best practices addressing the most common cases that people encounter. In addition to macros, perhaps also other types of optimizations like using `\` instead of `inv()`, or using in-place operations, or using `StaticArrays` where appropriate.

Does anyone know of any blog or tutorial does such comparison or suggests best practices? Maybe it would be good to maintain a document in GitHub so that people can suggest improvements, and also keep it up to date as new packages are released, or when things change between versions of Julia.

I think most researchers apart from engineering or CS are not experts in computation and simply code algorithms the way they think about them in math terms. They would be the target audience for such tips. I know that I for one would greatly appreciate such compilation.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [August 16, 2020, 1:10pm UTC](https://discourse.julialang.org/t/compilation-of-tips-for-speeding-up-computations/45033/2 "2020-08-16T13:10:47Z")

</div>

> [@amrods](#):
>
> whether there exists a compilation of tips and best practices addressing the most common cases that people encounter

I think that the most common cases are more or less covered in the _Performance Tips_ section you link above. Beyond that, they may be too numerous and problem-specific to list in a single place.

Your best bet is probably posting a self-contained MWE that people can optimize within an inch of its life. I learned a lot from discussions like that — I would recommend that you run and benchmark each proposed solution yourself.
