Skip to content

Performance Profiling

Takuya Iwanaga edited this page Oct 10, 2024 · 6 revisions

Basic timing and memory use assessment can be done with BenchmarkTools.jl.

The VS Code REPL includes profiling functionality to assess runtime and memory allocation issues.

# Profile performance in terms of percentage of time spent
@profview function_to_profile()

# Profile memory allocations
@profview_allocs function_to_profile()

The above approaches use the ProfileView.jl package, and is integrated into the VS Code extension, and auto-loaded into the VS Code Julia REPL.

An alternative to examining memory use is the Profile and PProf packages.

using Profile, PProf

@pprof function_to_profile()

There is also AllocCheck.jl which may be more straightforward to use.

Clone this wiki locally