diff --git a/src/execution.jl b/src/execution.jl index a9c3e25b..93a29099 100644 --- a/src/execution.jl +++ b/src/execution.jl @@ -701,9 +701,6 @@ information. """ macro bprofile(args...) _, params = prunekwargs(args...) - if !haskw(args, :gctrial) - args = (args..., Expr(:kw, :gctrial, false)) - end if !haskw(args, :gcsample) args = (args..., Expr(:kw, :gcsample, false)) end @@ -721,8 +718,11 @@ macro bprofile(args...) end ) $BenchmarkTools.Profile.clear() + $tmp.params.gctrial && $BenchmarkTools.gcscrub() #TODO: improve @bprofile to only measure the running code and none of the setup - $BenchmarkTools.@profile $BenchmarkTools.run($tmp, $tmp.params; warmup=false) + $BenchmarkTools.@profile $BenchmarkTools.run( + $tmp, $tmp.params; warmup=false, gctrial=false + ) end, ) end diff --git a/test/ExecutionTests.jl b/test/ExecutionTests.jl index 57666815..b348daa9 100644 --- a/test/ExecutionTests.jl +++ b/test/ExecutionTests.jl @@ -317,7 +317,7 @@ str = String(take!(io)) b = @bprofile 1 + 1 gctrial = true Profile.print(IOContext(io, :displaysize => (24, 200))) str = String(take!(io)) -@test occursin("gcscrub", str) +@test !occursin("gcscrub", str) ######## # misc #