On Ubuntu Trusty 64bits with i7 laptop, my result as follows. Notice the difference from Jason's

julia> @elapsed begin
                x = 0
                for n = 1:100000000
                  x += 1
                end
                x
              end
4.576735929

julia> function g()
                  x = 0
                  for n = 1:100000000 x += 1 end
                  return x
              end
g (generic function with 1 method)

julia> @elapsed g()
0.105158858

On 03/23/2014 12:18 PM, Jason Merrill wrote:
This is not a small nit that John is picking:

julia> @elapsed begin
         x = 0
         for n = 1:100000000
           x += 1
         end
         x
       end
7.333491931

julia> function g()
           x = 0
           for n = 1:100000000 x += 1 end
           return x
       end
g (generic function with 1 method)

julia> @elapsed g()
0.047755206

The second version makes you wonder what on earth PyPy is doing for a whole second ;-)


Reply via email to