Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions perf/benchmark.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,21 @@ function benchmark_driver!(f, x...; f_displayname=string(f))
x = (x..., nothing)

println("benchmarking $(f_displayname)...")
tf = Libtask.TapedFunction(f, x...)
tf = Libtask.TapedTask(nothing, f, x...)

print(" Run Original Function:")
@btime $f($(x)...)
GC.gc()

print(" Run TapedFunction:")
@btime $tf($(x)...)
GC.gc()

ctf = Libtask.compile(tf)
print(" Run TapedFunction (compiled):")
@btime $ctf($(x)...)
GC.gc()
# print(" Run TapedFunction:")
# @btime $tf($(x)...)
# GC.gc()

print(" Run TapedTask: ")
x = (x[1:(end - 1)]..., produce)
# show the number of produce calls inside `f`
function f_task(f, x; verbose=false)
tt = TapedTask(f, x...)
tt = TapedTask(nothing, f, x...)
c = 0
while consume(tt) !== nothing
c += 1
Expand Down
Loading