Re: [julia-users] ANN: unroll macro

2015-08-09 Thread Tom Breloff
I'm curious... Do you have any benchmarks of how much this can improve performance? On Saturday, August 8, 2015, vava...@uwaterloo.ca wrote: I implemented a short macro that unrolls for-loops that have constant bounds. For example @unroll for i = 1 : 4 a[i] = b[i] + c[i] +

Re: [julia-users] ANN: unroll macro

2015-08-09 Thread Jeffrey Sarnoff
Was this unrolling the example you gave that looped four times? Would it be correct to assume that the relative advantage is highly dependant upon loop repetitions? On Sunday, August 9, 2015 at 1:45:13 PM UTC-4, Tero Frondelius wrote: It seems that the package runtests.jl will give you the

Re: [julia-users] ANN: unroll macro

2015-08-09 Thread Tero Frondelius
It seems that the package runtests.jl will give you the answer: julia Pkg.test(Unroll) INFO: Testing Unroll TIMING TEST FOR SINGLE UNROLL no unrolling: 969.406 milliseconds (9523 allocations: 207 MB, 7.77% gc time) hand unrolled: 730.370 milliseconds (8170 allocations: 207 MB, 8.60% gc time)

[julia-users] ANN: unroll macro

2015-08-08 Thread vavasis
I implemented a short macro that unrolls for-loops that have constant bounds. For example @unroll for i = 1 : 4 a[i] = b[i] + c[i] + (mod(i,2)==0? d[i] : e[i]) end gets unrolled to a[1] = b[1] + c[1] + e[1] a[2] = b[2] + c[2] + d[2] a[3] = b[3] + c[3] +