You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using ProfileView to find out which parts of my code need to be optimized. Since the function I am looking at needs quite some preparation (defining variables, building structs, etc.) I decided to put everything inside a profile_my_stuff.jl. All works fine but the graph generated by view() shows quite some overhead left and right of my actual code. (caused by Revise.jl and Base.jl), see screenshot. Is there any way to get rid of these parts? I tried using the pruned keyword to get rid of these parts but it didn't work. I realize I could always just define my variables through the script and then run @profview from the REPL, but being able to have everything in a file would be neat.
Code to reproduce (run directly from REPL or via include("profile_my_stuff.jl"):
using ProfileView
functionprofile_test(n)
for i =1:n
A =randn(100,100,20)
m =maximum(A)
Am =mapslices(sum, A; dims=2)
B = A[:,:,5]
Bsort =mapslices(sort, B; dims=1)
b =rand(100)
C = B.*b
endend@profviewprofile_test(1) # run once to trigger compilation (ignore this one)@profviewprofile_test(10)
I'm using ProfileView to find out which parts of my code need to be optimized. Since the function I am looking at needs quite some preparation (defining variables, building structs, etc.) I decided to put everything inside a
profile_my_stuff.jl
. All works fine but the graph generated byview()
shows quite some overhead left and right of my actual code. (caused by Revise.jl and Base.jl), see screenshot. Is there any way to get rid of these parts? I tried using thepruned
keyword to get rid of these parts but it didn't work. I realize I could always just define my variables through the script and then run @profview from the REPL, but being able to have everything in a file would be neat.Code to reproduce (run directly from REPL or via
include("profile_my_stuff.jl")
:From REPL:
Via
include("profile_my_stuff.jl")
:My attempt using the
pruned
keyword:The text was updated successfully, but these errors were encountered: