# Profiling code reveals that most time is used calling 3 functions in task.jl

**URL:** https://discourse.julialang.org/t/profiling-code-reveals-that-most-time-is-used-calling-3-functions-in-task-jl/30751
**Category:** General Usage
**Tags:** question
**Created:** [November 5, 2019, 3:11pm UTC](https://discourse.julialang.org/t/profiling-code-reveals-that-most-time-is-used-calling-3-functions-in-task-jl/30751 "2019-11-05T15:11:18Z")
**Posts on this page:** 5
**Page:** 2

<div class="post-metadata">

### Author: ![ianshmean](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ianshmean/32/216042_2.png) [@ianshmean](https://discourse.julialang.org/u/ianshmean)
#### Post date: [March 2, 2025, 9:28pm UTC](https://discourse.julialang.org/t/profiling-code-reveals-that-most-time-is-used-calling-3-functions-in-task-jl/30751/21 "2025-03-02T21:28:36Z")

</div>

If you are on macOS, unfortunately recent macOS changes have caused julia’s profile unwinding to mostly fail.

If not, it could be that you’re not viewing the specific thread that work is being done?  
`Profile.@profile` and `Profile.print(groupby=:thread)` is one way to show by thread.

---

<div class="post-metadata">

### Author: ![Damiano](https://avatars.discourse-cdn.com/v4/letter/d/ebca7d/32.png) [@Damiano](https://discourse.julialang.org/u/Damiano)
#### Post date: [March 2, 2025, 9:42pm UTC](https://discourse.julialang.org/t/profiling-code-reveals-that-most-time-is-used-calling-3-functions-in-task-jl/30751/22 "2025-03-02T21:42:58Z")

</div>

I am on Linux. But I think you are right. On the top left of the flame graph that ProfileCanvas shows me there is a menu where I can choose threads. By default it shows `all`, but it gives the possibility of choosing different threads. If I choose 1, the bar corresponding to `poptask` disappear and only the `eval` one remains. If I choose anything else from 2 to 6, than only the `poptask` is shown. It is also the case that \frac{100}{6} \approx 17, which would also explain the percentages I get when the `all` option is selected.  
In conclusion, it does seem like there is no problem at all and everything is working as expected. Sorry for bringing up again this old question for nothing and thank you for the quick reply.

---

<div class="post-metadata">

### Author: ![ianshmean](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ianshmean/32/216042_2.png) [@ianshmean](https://discourse.julialang.org/u/ianshmean)
#### Post date: [March 2, 2025, 9:44pm UTC](https://discourse.julialang.org/t/profiling-code-reveals-that-most-time-is-used-calling-3-functions-in-task-jl/30751/23 "2025-03-02T21:44:52Z")

</div>

Does the dropdown mention the word “thread”? Could the UI be clearer?

---

<div class="post-metadata">

### Author: ![Damiano](https://avatars.discourse-cdn.com/v4/letter/d/ebca7d/32.png) [@Damiano](https://discourse.julialang.org/u/Damiano)
#### Post date: [March 2, 2025, 10:05pm UTC](https://discourse.julialang.org/t/profiling-code-reveals-that-most-time-is-used-calling-3-functions-in-task-jl/30751/24 "2025-03-02T22:05:26Z")

</div>

It does. Here are some quick screenshots.

 ![Screenshot From 2025-03-02 22-47-41](https://global.discourse-cdn.com/julialang/original/3X/0/a/0acf68e21feff58b150b553ec7ea60af36577a8a.png)  
 ![Screenshot From 2025-03-02 22-47-50](https://global.discourse-cdn.com/julialang/original/3X/b/b/bb0f901a6a4b055ec7649d5db2d560de507a50f9.png)  
 ![Screenshot From 2025-03-02 22-48-05](https://global.discourse-cdn.com/julialang/original/3X/a/5/a51d4e822fbaa630beb9907caf01c90b3a6f68ec.png)

At the moment, I do not have any suggestion on how to make this UI clearer. I would say the main problem was with me knowing nothing about profiling and threads: all of my knowledge comes from [this page of the documentation](https://docs.julialang.org/en/v1/manual/profile/#Profiling) (and I have found the reference to `ProfileCanvas.jl` [here](https://modernjuliaworkflows.org/optimizing/#profiling)).

I think it might be helpful to have an additional short paragraph in the Profiling page of the documentation I linked above, something mentioning that this is the kind of information one gets when one deals with multiple threads. Maybe one should also consider that the defaults (at least on my computer, but I think I did not make any changes from the standard installation) are that writing `julia` in the terminal launches it with only one thread (the output of `Threads.nthreads()` is 1), whereas by default IIRC Pluto runs with half the number of threads the computer has available. An inexperienced user could wonder why the results in the REPL and in the notebook would appear different.

However I would not feel comfortable writing it myself (again because of my absolute lack of knowledge on the topic).

---

<div class="post-metadata">

### Author: ![ianshmean](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ianshmean/32/216042_2.png) [@ianshmean](https://discourse.julialang.org/u/ianshmean)
#### Post date: [March 3, 2025, 1:50am UTC](https://discourse.julialang.org/t/profiling-code-reveals-that-most-time-is-used-calling-3-functions-in-task-jl/30751/25 "2025-03-03T01:50:37Z")

</div>

I’d happily review doc improvement attempts 🙂

[Previous page](https://discourse.julialang.org/t/profiling-code-reveals-that-most-time-is-used-calling-3-functions-in-task-jl/30751.md?page=1)
