Created
June 4, 2020 21:04
-
-
Save daviehh/e82424bf83b124ae135cd130e401bde5 to your computer and use it in GitHub Desktop.
profile stat. array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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