Skip to content

Commit da227d4

Browse files
committed
Avoid running setup expressions unnecessarily
1 parent d62c68c commit da227d4

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
@@ -585,7 +585,6 @@ function generate_benchmark_definition(
585585
),
586586
)
587587
if $(params.experimental_enable_linux_perf)
588-
$(setup)
589588
# Based on https://github.com/JuliaPerf/LinuxPerf.jl/blob/a7fee0ff261a5b5ce7a903af7b38d1b5c27dd931/src/LinuxPerf.jl#L1043-L1061
590589
__linux_perf_groups = BenchmarkTools.LinuxPerf.set_default_spaces(
591590
$(params.linux_perf_options.events),
@@ -606,10 +605,9 @@ function generate_benchmark_definition(
606605
end
607606
end
608607

609-
if isnothing(__linux_perf_bench)
610-
$(teardown)
611-
else
608+
if !isnothing(__linux_perf_bench)
612609
try
610+
$(setup)
613611
BenchmarkTools.LinuxPerf.enable!(__linux_perf_bench)
614612
# We'll just run it one time.
615613
__return_val_2 = $(invocation)

0 commit comments

Comments
 (0)