# Profiling

**URL:** https://discourse.julialang.org/c/tools/profiling/64.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [About the Profiling category](https://discourse.julialang.org/t/about-the-profiling-category/91156)

<div class="topic-metadata">

**Author:** [@vchuravy](https://discourse.julialang.org/u/vchuravy)\
**Replies:** 0

</div>

Profiling and performance analysis for Julia. Profiling resources Below is a community maintained list of julia profiling tools. Please feel free to edit this wiki post. Profiling concept/area URL Notes Screenshot …

---

## [A visual log of loading and precompilation times for many packages over a variety of julia versions](https://discourse.julialang.org/t/a-visual-log-of-loading-and-precompilation-times-for-many-packages-over-a-variety-of-julia-versions/133887)

<div class="topic-metadata">

**Author:** [@Krastanov](https://discourse.julialang.org/u/Krastanov)\
**Replies:** 10\
**Last updated:** [November 22, 2025, 7:06pm UTC](https://discourse.julialang.org/t/a-visual-log-of-loading-and-precompilation-times-for-many-packages-over-a-variety-of-julia-versions/133887 "2025-11-22T19:06:08Z")

</div>

At Julia Ecosystem Benchmarks Explorer you can find detailed benchmarks of loading time for many packages over many different versions of julia, all interactively explorable. This is the culmination of: @tecosaur sett…

---

## [How to track total memory usage of Julia process over time](https://discourse.julialang.org/t/how-to-track-total-memory-usage-of-julia-process-over-time/91167)

<div class="topic-metadata">

**Author:** [@sloede](https://discourse.julialang.org/u/sloede)\
**Replies:** 17\
**Last updated:** [June 6, 2025, 9:34pm UTC](https://discourse.julialang.org/t/how-to-track-total-memory-usage-of-julia-process-over-time/91167 "2025-06-06T21:34:01Z")

</div>

What is a good tool to track the memory usage of the Julia process over time? Ideally, I would like to find out how much memory is used by Julia at any given time, especially at peak times during, e.g., compilation, but …

---

## [New on Forem: “Profile a short-running function”](https://discourse.julialang.org/t/new-on-forem-profile-a-short-running-function/129581)

<div class="topic-metadata">

**Author:** [@oheil](https://discourse.julialang.org/u/oheil)\
**Replies:** 0\
**Last updated:** [June 2, 2025, 7:37pm UTC](https://discourse.julialang.org/t/new-on-forem-profile-a-short-running-function/129581 "2025-06-02T19:37:05Z")

</div>

@nsajko shows some insights into profiling Julia on Forem: Thanks for sharing this!

---

## [PythonCall allocations](https://discourse.julialang.org/t/pythoncall-allocations/128886)

<div class="topic-metadata">

**Author:** [@Refaat\_Ismail](https://discourse.julialang.org/u/Refaat_Ismail)\
**Replies:** 7\
**Last updated:** [May 20, 2025, 6:47am UTC](https://discourse.julialang.org/t/pythoncall-allocations/128886 "2025-05-20T06:47:45Z")

</div>

I am trying to understand how to minimize allocations in PythonCall. Here, I am using stim, a python library, to generate samples (stored in numpy arrays). I have two implementations: function generate\_samples(;circ\_str…

---

## [How do I get Test Coverage not to mess up @allocated calculations](https://discourse.julialang.org/t/how-do-i-get-test-coverage-not-to-mess-up-allocated-calculations/128418)

<div class="topic-metadata">

**Author:** [@Allan\_Baker](https://discourse.julialang.org/u/Allan_Baker)\
**Replies:** 3\
**Last updated:** [April 27, 2025, 8:29pm UTC](https://discourse.julialang.org/t/how-do-i-get-test-coverage-not-to-mess-up-allocated-calculations/128418 "2025-04-27T20:29:23Z")

</div>

I have a runtests.jl which does something like this. ff()=@allocated myfun(vara,varb, varc) @test ff()=0 This returns true if not running with code coverage and then it fails when testing with code-coverage. But not …

---

## [Interaction Between Caching and Benchmarking](https://discourse.julialang.org/t/interaction-between-caching-and-benchmarking/123935)

<div class="topic-metadata">

**Author:** [@TimHargreaves](https://discourse.julialang.org/u/TimHargreaves)\
**Replies:** 2\
**Last updated:** [December 18, 2024, 5:06pm UTC](https://discourse.julialang.org/t/interaction-between-caching-and-benchmarking/123935 "2024-12-18T17:06:38Z")

</div>

I have a high-level question motivated by a specific example of something strange I’m observing. The high-level question is whether L2/L3 memory caching can have an impact on benchmarking using BenchmarkTools.jl. Specif…

---

## [Profiling BLAS-heavy code on Mac OS X: workaround for libunwind bug?](https://discourse.julialang.org/t/profiling-blas-heavy-code-on-mac-os-x-workaround-for-libunwind-bug/122813)

<div class="topic-metadata">

**Author:** [@cdwhite1](https://discourse.julialang.org/u/cdwhite1)\
**Replies:** 2\
**Last updated:** [November 19, 2024, 4:04pm UTC](https://discourse.julialang.org/t/profiling-blas-heavy-code-on-mac-os-x-workaround-for-libunwind-bug/122813 "2024-11-19T16:04:09Z")

</div>

I’m on Mac OS X Sonoma (14.7), julia 1.10.5, trying to profile some linear-algebra-heavy code. I’m running into behavior very similar to that described in a previous thread (flamegraph-profileview-not-showing-matrix-oper…

---

## [Why is my root process so much longer than my other processes?](https://discourse.julialang.org/t/why-is-my-root-process-so-much-longer-than-my-other-processes/122673)

<div class="topic-metadata">

**Author:** [@Thomas\_Van\_Giel](https://discourse.julialang.org/u/Thomas_Van_Giel)\
**Replies:** 3\
**Last updated:** [November 18, 2024, 2:59am UTC](https://discourse.julialang.org/t/why-is-my-root-process-so-much-longer-than-my-other-processes/122673 "2024-11-18T02:59:22Z")

</div>

I’m trying to profile my code with the @profview command in VScode. After ~1000 seconds of running, this is what the profiling gives me: What could be the reasons root taking so much longer than all my other processe…

---

## [ProfileView.@profview seemingly breaks reproducibility of my results](https://discourse.julialang.org/t/profileview-profview-seemingly-breaks-reproducibility-of-my-results/117893)

<div class="topic-metadata">

**Author:** [@JADekker](https://discourse.julialang.org/u/JADekker)\
**Replies:** 6\
**Last updated:** [August 8, 2024, 9:23am UTC](https://discourse.julialang.org/t/profileview-profview-seemingly-breaks-reproducibility-of-my-results/117893 "2024-08-08T09:23:49Z")

</div>

I’ve written an algorithm (spanning many, many lines) to solve a certain optimal control problem, which involves both simulation and optimisation. To make sure that different runs provide the same results, I set ‘Random.…

---

## [Understanding SnoopCompile timings](https://discourse.julialang.org/t/understanding-snoopcompile-timings/116892)

<div class="topic-metadata">

**Author:** [@theogf](https://discourse.julialang.org/u/theogf)\
**Replies:** 2\
**Last updated:** [July 20, 2024, 2:22pm UTC](https://discourse.julialang.org/t/understanding-snoopcompile-timings/116892 "2024-07-20T14:22:26Z")

</div>

Hi, First of all SnoopCompile.jl is such an amazing package! Thanks a lot @tim.holy . After using it for a while there is still something I have trouble understanding: When running @snoopi\_deep f(), the exclusive/incl…

---

## [Matrix power not memory optimal](https://discourse.julialang.org/t/matrix-power-not-memory-optimal/116201)

<div class="topic-metadata">

**Author:** [@jarl](https://discourse.julialang.org/u/jarl)\
**Replies:** 11\
**Last updated:** [June 25, 2024, 6:12pm UTC](https://discourse.julialang.org/t/matrix-power-not-memory-optimal/116201 "2024-06-25T18:12:32Z")

</div>

It seems that computing A^p with integer p for a dense matrix A with ^(A,p) is not memory allocation optimal: julia\> using BenchmarkTools, LinearAlgebra julia\> A=randn(256,256); A=A/norm(A); julia\> @btime A8=A^8; 813.…

---

## [Why Mac mini M1 and Mac book air have 4 times performance difference?](https://discourse.julialang.org/t/why-mac-mini-m1-and-mac-book-air-have-4-times-performance-difference/115094)

<div class="topic-metadata">

**Author:** [@lksj12](https://discourse.julialang.org/u/lksj12)\
**Replies:** 12\
**Last updated:** [June 3, 2024, 2:11pm UTC](https://discourse.julialang.org/t/why-mac-mini-m1-and-mac-book-air-have-4-times-performance-difference/115094 "2024-06-03T14:11:02Z")

</div>

I tested exactly same julia code in MacBookAir 2020(M1, RAM: 8GB) and MaMini 2020(M1, RAM 16GB). The code is using LaTeXStrings using DelimitedFiles using Printf using GZip using Statistics using LinearAlgebra using Py…

---

## [Alternatives to flame graphs for profiler](https://discourse.julialang.org/t/alternatives-to-flame-graphs-for-profiler/103328)

<div class="topic-metadata">

**Author:** [@pjuergens](https://discourse.julialang.org/u/pjuergens)\
**Replies:** 6\
**Last updated:** [November 20, 2023, 12:03am UTC](https://discourse.julialang.org/t/alternatives-to-flame-graphs-for-profiler/103328 "2023-11-20T00:03:59Z")

</div>

Hello there, I am wondering if there is an alternative way to show profiler results (at best in VS Code) than a simple flame graph. What I’m basically looking for is a way to see cumulated time spend in a function/line …

---

## [How to asychronously build a benchmark group](https://discourse.julialang.org/t/how-to-asychronously-build-a-benchmark-group/106335)

<div class="topic-metadata">

**Author:** [@filchristou](https://discourse.julialang.org/u/filchristou)\
**Replies:** 3\
**Last updated:** [November 17, 2023, 8:35pm UTC](https://discourse.julialang.org/t/how-to-asychronously-build-a-benchmark-group/106335 "2023-11-17T20:35:04Z")

</div>

Can I build several inter-depending benchmarks from a serial procedure in “one go” using BenchmarkTools.jl ? Say I have the following functionality laid out in a function function mymutatingfunc!(x) mutfunc1!(x) …

---

## [Making @benchmark outputs statistically meaningful, and actionable](https://discourse.julialang.org/t/making-benchmark-outputs-statistically-meaningful-and-actionable/104256)

<div class="topic-metadata">

**Author:** [@user664303](https://discourse.julialang.org/u/user664303)\
**Replies:** 123\
**Last updated:** [November 15, 2023, 1:01pm UTC](https://discourse.julialang.org/t/making-benchmark-outputs-statistically-meaningful-and-actionable/104256 "2023-11-15T13:01:44Z")

</div>

I see a huge disparity in the output of different runs of @benchmark, for the same code. See the following two outputs, made consecutively, with zero code changes and no restarting Julia: BenchmarkTools.Trial: 161 sampl…

---

## [Should we enable storage of function outputs in BenchmarkTools?](https://discourse.julialang.org/t/should-we-enable-storage-of-function-outputs-in-benchmarktools/103997)

<div class="topic-metadata">

**Author:** [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Replies:** 13\
**Last updated:** [September 26, 2023, 3:01pm UTC](https://discourse.julialang.org/t/should-we-enable-storage-of-function-outputs-in-benchmarktools/103997 "2023-09-26T15:01:11Z")

</div>

Currently doing some maintenance on BenchmarkTools.jl before the upcoming 2.0 release (I’m aiming for October), and I stumbled upon a PR I’m unsure about. The author @AlexanderNenninger wants to record the values return…

---

## [Why is all profiling wrapped around an evaluation?](https://discourse.julialang.org/t/why-is-all-profiling-wrapped-around-an-evaluation/102759)

<div class="topic-metadata">

**Author:** [@Ross\_Boylan](https://discourse.julialang.org/u/Ross_Boylan)\
**Replies:** 4\
**Last updated:** [August 14, 2023, 6:41pm UTC](https://discourse.julialang.org/t/why-is-all-profiling-wrapped-around-an-evaluation/102759 "2023-08-14T18:41:25Z")

</div>

As far as I can tell, all the basic performance measurement tools operate by giving a macro an expression to evaluate. This seems odd to me, and I think I’m missing an understanding of why this is so. This question is …

---

## [Julia hangs on \`using PProf\`](https://discourse.julialang.org/t/julia-hangs-on-using-pprof/102646)

<div class="topic-metadata">

**Author:** [@Larbino1](https://discourse.julialang.org/u/Larbino1)\
**Replies:** 1\
**Last updated:** [August 9, 2023, 4:26pm UTC](https://discourse.julialang.org/t/julia-hangs-on-using-pprof/102646 "2023-08-09T16:26:19Z")

</div>

I’m trying to do some allocation profiling. I start a thread, which is reading from a pipe, and I want to check that it is not allocating. Then, I do using PProf and julia hangs. If I do using PProf before starting th…

---

## [How to measure precompilation time?](https://discourse.julialang.org/t/how-to-measure-precompilation-time/102617)

<div class="topic-metadata">

**Author:** [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Replies:** 11\
**Last updated:** [August 9, 2023, 9:39am UTC](https://discourse.julialang.org/t/how-to-measure-precompilation-time/102617 "2023-08-09T09:39:07Z")

</div>

Source of latency Measurement method Precompilation time ??? Load time @time\_imports using MyPackage Compilation time @time MyPackage.myfunc() I could do @time Pkg.add("MyPackage") but it combines the down…

---

## [Nsight compute fails to launch julia](https://discourse.julialang.org/t/nsight-compute-fails-to-launch-julia/99636)

<div class="topic-metadata">

**Author:** [@bthorne93](https://discourse.julialang.org/u/bthorne93)\
**Replies:** 3\
**Last updated:** [May 31, 2023, 2:28pm UTC](https://discourse.julialang.org/t/nsight-compute-fails-to-launch-julia/99636 "2023-05-31T14:28:49Z")

</div>

I am trying to profile a julia cuda application using Nsight compute, however I am running into an obscure error before julia even seems to be launched. This only occurs on versions 1.9 and 1.8, version \<1.7 actually wor…

---

## [Can't load CUDA.jl when I launch julia under Nsight compute](https://discourse.julialang.org/t/cant-load-cuda-jl-when-i-launch-julia-under-nsight-compute/97810)

<div class="topic-metadata">

**Author:** [@yuwenchen95](https://discourse.julialang.org/u/yuwenchen95)\
**Replies:** 2\
**Last updated:** [April 23, 2023, 10:18pm UTC](https://discourse.julialang.org/t/cant-load-cuda-jl-when-i-launch-julia-under-nsight-compute/97810 "2023-04-23T22:18:18Z")

</div>

When I launch julia with Nsight Compute 2023.1.1 as follows, ncu --mode=launch julia I get stalled when I try to load CUDA.jl at the command: using CUDA Anyone has the idea to solve it? Thanks in advance.

---

## [What is pthread\_cond\_wait in PProf.jl output?](https://discourse.julialang.org/t/what-is-pthread-cond-wait-in-pprof-jl-output/94229)

<div class="topic-metadata">

**Author:** [@aksahoo](https://discourse.julialang.org/u/aksahoo)\
**Replies:** 1\
**Last updated:** [February 17, 2023, 1:24am UTC](https://discourse.julialang.org/t/what-is-pthread-cond-wait-in-pprof-jl-output/94229 "2023-02-17T01:24:36Z")

</div>

I got a pthread\_cond\_wait in my profilling with PProf.jl What does that men? and how to avoid that or reduce that time?

---

## [About PProf](https://discourse.julialang.org/t/about-pprof/93456)

<div class="topic-metadata">

**Author:** [@Kristin](https://discourse.julialang.org/u/Kristin)\
**Replies:** 8\
**Last updated:** [January 25, 2023, 10:43am UTC](https://discourse.julialang.org/t/about-pprof/93456 "2023-01-25T10:43:29Z")

</div>

Dear there, I’ve a quick question about PProf. I’m using Julia 1.8.4, and I’m learning the new profile tool. So I follow a simple example as below. I first define a function: function myfunc() A = rand(200, 200,…
