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 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)
> unrolled by the macro
>  627.025 milliseconds (8178 allocations: 207 MB, 4.59% gc time)
> TIMING TEST FOR NESTED UNROLL
> no unrolling:
>    1.520 seconds      (11846 allocations: 207 MB, 2.09% gc time)
> hand unrolled:
>  953.836 milliseconds (10606 allocations: 207 MB, 6.29% gc time)
> unrolled by the macro
>  946.106 milliseconds (10630 allocations: 207 MB, 5.98% gc time)
> TIMING TEST FOR IF-THEN UNROLL
> no unrolling:
>  961.234 milliseconds (10637 allocations: 207 MB, 3.31% gc time)
> hand unrolled:
>  652.259 milliseconds (8180 allocations: 207 MB, 9.01% gc time)
> unrolled by the macro
>  672.239 milliseconds (8204 allocations: 207 MB, 8.47% gc time)
> INFO: Unroll tests passed
>
> julia> 
>
>
>
>
> On Sunday, August 9, 2015 at 4:41:24 PM UTC+3, Tom Breloff wrote:
>>
>> I'm curious... Do you have any benchmarks of how much this can improve 
>> performance?
>>
>> On Saturday, August 8, 2015, <[email protected]> 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] + (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] + e[3]
>>>      a[4] = b[4] + c[4] + d[4]
>>>
>>> See:  https://github.com/StephenVavasis/Unroll.jl
>>>
>>>
>>>

Reply via email to