Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function testVec(t,v,k,n)
- for i=1:n
- t .= v .* 3 .+ k .* 4;
- end
- end
- module params
- r = 3;
- end
- function testVec2(t,v,k,n)
- for i=1:n
- t .= v .* params.r .+ k .* 4;
- end
- end
- @time testVec([1 2 3 4], [2 3 4 5], [3 4 5 6], 1000)
- 0.000036 seconds (7 allocations: 496 bytes)
- @time testVec2([1 2 3 4], [2 3 4 5], [3 4 5 6], 1000)
- 0.003180 seconds (4.01 k allocations: 141.109 KiB)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement