Le samedi 15 février 2014 11:30:12 UTC+1, Tim Holy a écrit :
>
> You're running into the classic globals problem, see the performance tips 
> section of the manual.
>
>
I am sorry, I don't understand your remark. There are no global variables 
in the code I posted previously.
Also, wrapping the code in a function does not get better performance. 
Maybe I don't understand what is the classic globals problem? 

julia> 
function test () ;
let biglist = [string(i) for i in 1:20000] , result = BigInt(1); 
       @time for x in biglist ; result = result * BigInt(x) ; end ; result 
; end
end

julia> test (generic function with 1 method)

julia> test()
elapsed time: 0.396508521 seconds (304614928 bytes allocated)


julia> test()
elapsed time: 0.393320767 seconds (304614928 bytes allocated)


Reply via email to