Skip to content

Commit eab4dee

Browse files
committed
Avoid running setup expressions unnecessarily
1 parent 68d1cc9 commit eab4dee

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
@@ -587,7 +587,6 @@ function generate_benchmark_definition(
587587
),
588588
)
589589
if $(params.experimental_enable_linux_perf)
590-
$(setup)
591590
# Based on https://github.com/JuliaPerf/LinuxPerf.jl/blob/a7fee0ff261a5b5ce7a903af7b38d1b5c27dd931/src/LinuxPerf.jl#L1043-L1061
592591
__linux_perf_groups = BenchmarkTools.LinuxPerf.set_default_spaces(
593592
$(params.linux_perf_options.events),
@@ -608,10 +607,9 @@ function generate_benchmark_definition(
608607
end
609608
end
610609

611-
if isnothing(__linux_perf_bench)
612-
$(teardown)
613-
else
610+
if !isnothing(__linux_perf_bench)
614611
try
612+
$(setup)
615613
BenchmarkTools.LinuxPerf.enable!(__linux_perf_bench)
616614
# We'll just run it one time.
617615
__return_val_2 = $(invocation)

0 commit comments

Comments
 (0)