Trying to understand ProfileView output

I am trying to figure what’s going on with some code that i am profiling. As you can see there from the graph below, there is a very large area at the left showing code that is clearly part of the Julia system (type_infer.jl is right above boot.jl). Does it have to do with some type instability? By the way, I am running the profiler inside an IPython notebook. I am also passing an array that my code will modify in place:

using ProfileView

PDF12 = zeros(256, 256)
@profview PDF = NPWindows.jointPDF!(PDF12, mat1, mat2, 1.0, 1.0, 256, 256, 0.1)

I am also wondering why there is a long time in the middle of the graph where the CPU seems to be idling in the same line of code, in other words it seems no other function is called. This would be consistent with a loop where no operation is performed, and there is nothing like that in my code.

Have you tried to run function before executing @profile? It looks like together with the function execution, you also show function compilation stacktrace, which is probably not what you want.

1 Like

Yes, that fixed it! Thanks @Skoffer

1 Like