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/).

The ProfileView package provides a nice graphical browser to investigate profile results (follow the tutorial at https://github.com/timholy/ProfileView.jl).

BenchmarkingTools is an excellent package with macros and tools for benchmarking your code.

For more tips, examples, and argumentation about performance, look up http://docs.julialang.org/en/latest/manual/performance-tips/.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.59.48.161