Performance tips

Julia is quick, but poor coding can slow it down markedly. If you are developing enterprise software and/or distributing on GitHub, you need to pay more attention to some of the features and nuances of the language.

The online manual has a long section on performance tips, including a useful style guide and a section of frequently asked questions, which will prove to be illuminating. I've cherry-picked a few that I found of interest.

Best practice

First, a few points about variables, arrays, and types:

  • Global variables: These may change at different points, so it is hard for the compiler to optimize the code. Wherever possible, variables should be locally defined or passed to functions as arguments. If a variable is actually being ...

Get Mastering Julia now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.