Skip to content

Commit 857fd4e

Browse files
authored
Update benchmark.jl
1 parent 779aa31 commit 857fd4e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

perf/benchmark.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,19 @@ function benchmark_driver!(f, x...; f_displayname=string(f))
2525

2626
print(" Run TapedTask: ")
2727
x = (x[1:end-1]..., produce);
28-
tf = Libtask.TapedFunction(f, x...);
2928
# show the number of produce calls inside `f`
30-
f_task = (tf, x; verbose=false) -> begin
31-
tt = TapedTask(tf, x...);
29+
f_task = (f, x; verbose=false) -> begin
30+
tt = TapedTask(f, x...);
3231
c = 0
3332
while consume(tt)!==nothing
3433
c+=1
3534
end
3635
verbose && print("#produce=", c, "; ");
3736
end
38-
f_task(tf, x; verbose=true) # print #produce calls.
39-
@btime $f_task($tf, $x)
37+
# Note that we need to pass `f` instead of `tf` to avoid
38+
# default continuation in `TapedTask` constructor
39+
f_task(f, x; verbose=true) # print #produce calls
40+
@btime $f_task($f, $x)
4041
GC.gc()
4142
end
4243

0 commit comments

Comments
 (0)