Tools to use

Execute a function with certain parameter values, and then use @time (refer to the Generic functions and multiple dispatch section in Chapter 3, Functions) to measure the elapsed time and memory allocation. If too much memory is allocated, investigate the code for type problems.

Experiment with different tips and techniques in the script array_product_benchmark.jl. Use code_typed (refer to the Reflection capabilities section in Chapter 7, Metaprogramming in Julia) to see if type Any is inferred.

A profiler tool is available in the standard library to measure the performance of your running code and identify possible bottleneck lines. This works through calling your code with the @profile macro (refer to ...

Get Julia 1.0 Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.