# How to understand the ProfileView output

**URL:** <https://discourse.julialang.org/t/how-to-understand-the-profileview-output/79968>\
**Category:** Performance\
**Tags:** question, package, plotting, profiling\
**Created:** [April 25, 2022, 6:09am UTC](https://discourse.julialang.org/t/how-to-understand-the-profileview-output/79968 "2022-04-25T06:09:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Himbeersternchen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/himbeersternchen/32/19078_2.png) [@Himbeersternchen](https://discourse.julialang.org/u/Himbeersternchen)\
**Post date:** [April 25, 2022, 6:09am UTC](https://discourse.julialang.org/t/how-to-understand-the-profileview-output/79968/1 "2022-04-25T06:09:20Z")

</div>

Hello Everyone,

Similar as this [topic](https://discourse.julialang.org/t/trying-to-understand-profileview-output/63561), i want to understand the profileview output. The test code is as Following:

```julia

init() = begin
    n = 250
    a1 = Vector{Vector{Float64}}(undef, n)
    for i in 1:n 
        a1[i] = [rand(), rand()]
    end
    a1
end

# without multithreading
round_serial(a1) = begin
    n = length(a1)
    a2 = Vector{Vector{Float64}}(undef, n)
    for i in 1:n 
        a2[i] = [round(x, digits=5) for x in a1[i]]
    end
    a2
end

# with multithreading
round_parallel(a1) = begin
    n = length(a1)
    a3 = Vector{Vector{Float64}}(undef, n)
    Threads.@threads for i in 1:n 
        a3[i] = [round(x, digits=5) for x in a1[i]]
    end
    a3
end

a1 = init()
a2 = @elapsed @profview round_serial(a1)
a3 = @elapsed @profview round_parallel(a1)

```

Profile plot for round\_serial(a1) looks like:

 ![without_multithreading](https://global.discourse-cdn.com/julialang/original/3X/0/2/0250aad09c22a1ca7b4d9c9bbe217f7b68d75233.png)  
Profile plot for round\_parallel(a1) looks like:  
 ![with_multithreading](https://global.discourse-cdn.com/julialang/original/3X/a/8/a845cc3cf16eb45fec913f710eeb75ef316b2bf8.png)  
The Base funcstions are not that I’m familiar with. I have read [topic](https://discourse.julialang.org/t/trying-to-understand-profileview-output/63561) and I have not @profile in my code, so I dont know, how to eliminate the white spaces. And i want to know, what is the crucial message of those both plots, which i should extract with my brain. Because i m not sure, which base function corresponds to which line of code. If there is any documentation about understanding profile plot, I would be happy to read it.

---

<div class="post-metadata">

**Author:** ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Post date:** [April 25, 2022, 10:48am UTC](https://discourse.julialang.org/t/how-to-understand-the-profileview-output/79968/2 "2022-04-25T10:48:19Z")

</div>

I would have imagined you might have found it already, but [GitHub - timholy/ProfileView.jl: Visualization of Julia profiling data](https://github.com/timholy/ProfileView.jl), but describes how to interpret the bars. It’s worth running that specific example interactively while reading the documentation.

With regards to your threaded implementation, there have been significant enhancements in profiling threads in Julia 1.8. I highly recommend downloading the current 1.8-beta and trying that.

---

<div class="post-metadata">

**Author:** ![Himbeersternchen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/himbeersternchen/32/19078_2.png) [@Himbeersternchen](https://discourse.julialang.org/u/Himbeersternchen)\
**Post date:** [April 26, 2022, 2:59pm UTC](https://discourse.julialang.org/t/how-to-understand-the-profileview-output/79968/3 "2022-04-26T14:59:43Z")

</div>

Sorry for my late reply and thanks for your answer! I have roughly read this page [https://github.com/timholy/ProfileView.jl](https://github.com/timholy/ProfileView.jl) and I want to ask for a better understanding, are the white spaces of the 2. plot the load time for the macro threads?

---

<div class="post-metadata">

**Author:** ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Post date:** [April 29, 2022, 9:52am UTC](https://discourse.julialang.org/t/how-to-understand-the-profileview-output/79968/4 "2022-04-29T09:52:54Z")

</div>

White space indicates that no Julia code is running. By default, ProfileView suppresses bars that come from C code, but you can show them with `ProfieView.view(; C=true)`. But it could also be that the process is sleeping. For deeper investigation of why, you really shouldn’t waste your time with anything earlier than Julia-1.8.
