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 https://docs.julialang.org/en/latest/manual/profile/ ...

Get Julia 1.0 Programming 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.