Hello Everyone,
Similar as this topic, i want to understand the profileview output. The test code is as Following:
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:
Profile plot for round_parallel(a1) looks like:
The Base funcstions are not that I’m familiar with. I have read topic 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.