Skip to content

Instantly share code, notes, and snippets.

@daviehh
Created June 4, 2020 21:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daviehh/e82424bf83b124ae135cd130e401bde5 to your computer and use it in GitHub Desktop.
Save daviehh/e82424bf83b124ae135cd130e401bde5 to your computer and use it in GitHub Desktop.
profile stat. array
using StaticArrays
using Profile
using Juno
function g!(r,a,b,c,d)
@. r = a + 5 * b + 3 * c - d
end
function g1a!(r,a,b,c,d)
@. r = 1 * a + 5 * b + 3 * c - d
end
function profile_call()
n = 5
as = @MMatrix rand(n, n)
bs = @MMatrix rand(n, n)
cs = @MMatrix rand(n, n)
ds = @MMatrix rand(n, n)
rs = @MMatrix rand(n, n)
for i = 1:1000
g!(rs,as,bs,cs,ds)
end
end
@time profile_call()
Profile.clear()
Profile.init(n = Int(1e8), delay = 1e-7)
Profile.clear()
@profiler profile_call()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment