Just to be clear, how are you running this code on nightly? With BenchmarkTools 0.0.8 or latest master on Julia 92fa0f3ace (0 days old master), I get
julia> @btime sum(a * b for (a, b) in zip(x, y));
ERROR: syntax: invalid syntax (escape (call (outerref sum) (call (top Generator) (block (null) (block (= #9 (new ##9#11)) (null) (unnecessary #9))) (call (outerref zip) (outerref x) (outerref y)))))
Stacktrace:
[1] generate_benchmark_definition(::Module, ::Array{Symbol,1}, ::Array{Any,1}, ::Expr, ::Void, ::Void, ::BenchmarkTools.Parameters) at /Users/twan/code/julia/RigidBodyDynamics/v0.7/BenchmarkTools/src/execution.jl:289
julia> @btime sum(t[1] * t[2] for t in zip(x, y));
ERROR: syntax: invalid syntax (escape (call (outerref sum) (call (top Generator) (block (null) (block (= #12 (new ##12#14)) (null) (unnecessary #12))) (call (outerref zip) (outerref x) (outerref y)))))
Stacktrace:
[1] generate_benchmark_definition(::Module, ::Array{Symbol,1}, ::Array{Any,1}, ::Expr, ::Void, ::Void, ::BenchmarkTools.Parameters) at /Users/twan/code/julia/RigidBodyDynamics/v0.7/BenchmarkTools/src/execution.jl:289
(https://github.com/JuliaCI/BenchmarkTools.jl/issues/69)
I can get things to work using
b = @benchmarkable sum(a * b for (a, b) in zip(x, y))
run(b)
in which case there is no difference between the two (while there still is a difference on 0.6 when you first use @benchmarkable
and then run
).