Skip to content

Commit e87263f

Browse files
committed
Avoid running setup expressions unnecessarily
1 parent 1b50952 commit e87263f

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
@@ -580,7 +580,6 @@ function generate_benchmark_definition(
580580
),
581581
)
582582
if $(params.experimental_enable_linux_perf)
583-
$(setup)
584583
# Based on https://github.com/JuliaPerf/LinuxPerf.jl/blob/a7fee0ff261a5b5ce7a903af7b38d1b5c27dd931/src/LinuxPerf.jl#L1043-L1061
585584
__linux_perf_groups = BenchmarkTools.LinuxPerf.set_default_spaces(
586585
$(params.linux_perf_options.events),
@@ -601,10 +600,9 @@ function generate_benchmark_definition(
601600
end
602601
end
603602

604-
if isnothing(__linux_perf_bench)
605-
$(teardown)
606-
else
603+
if !isnothing(__linux_perf_bench)
607604
try
605+
$(setup)
608606
BenchmarkTools.LinuxPerf.enable!(__linux_perf_bench)
609607
# We'll just run it one time.
610608
__return_val_2 = $(invocation)

0 commit comments

Comments
 (0)