Skip to content

Commit fdd14ab

Browse files
committed
Avoid running setup expressions unnecessarily
1 parent b3f66b2 commit fdd14ab

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/execution.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,6 @@ function generate_benchmark_definition(
573573
),
574574
)
575575
if $(params.experimental_enable_linux_perf)
576-
$(setup)
577576
# Based on https://github.com/JuliaPerf/LinuxPerf.jl/blob/a7fee0ff261a5b5ce7a903af7b38d1b5c27dd931/src/LinuxPerf.jl#L1043-L1061
578577
__linux_perf_groups = BenchmarkTools.LinuxPerf.set_default_spaces(
579578
$(params.linux_perf_options.events),
@@ -594,10 +593,9 @@ function generate_benchmark_definition(
594593
end
595594
end
596595

597-
if isnothing(__linux_perf_bench)
598-
$(teardown)
599-
else
596+
if !isnothing(__linux_perf_bench)
600597
try
598+
$(setup)
601599
BenchmarkTools.LinuxPerf.enable!(__linux_perf_bench)
602600
# We'll just run it one time.
603601
__return_val_2 = $(invocation)

0 commit comments

Comments
 (0)