Skip to content

Commit

Permalink
change timing method in perfutil to use averaging and include GC time
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Jul 7, 2013
1 parent f07ca6d commit b02ea62
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions test/perf/perfutil.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ print_output = isempty(ARGS) || contains(ARGS, "perf/perf.jl") || contains(ARGS,

macro timeit(ex,name)
quote
t = Inf
for i=1:5
t = min(t, @elapsed $ex)
gc()
t = 0.0
for i=1:6
s = (@elapsed $(esc(ex)))
if i > 1
t += s
end
end
if print_output
println("julia,", $name, ",", t*1000)
println("julia,", $name, ",", (t/5)*1000)
end
gc()
end
end

Expand Down

0 comments on commit b02ea62

Please sign in to comment.