Skip to content

Commit 95da3ba

Browse files
committed
Cleanup
1 parent fe22190 commit 95da3ba

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

src/execution.jl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -628,13 +628,11 @@ function generate_benchmark_definition(
628628
__prehook_result, __posthook_result, __return_val = $BenchmarkTools.@noinline (
629629
function (__evals)
630630
prehook_result = $BenchmarkTools.samplefunc_prehook()
631-
# We'll run it evals times.
632631
$BenchmarkTools.@noinline __return_val_2 = $(invocation)
633632
for __iter in 2:__evals
634633
$BenchmarkTools.@noinline $(invocation)
635634
end
636635
posthook_result = $BenchmarkTools.samplefunc_posthook()
637-
# trick the compiler not to eliminate the code
638636
return prehook_result, posthook_result, __return_val_2
639637
end
640638
)(
@@ -655,8 +653,6 @@ function generate_benchmark_definition(
655653
__params
656654
)
657655
$BenchmarkTools.@noinline $(setup)
658-
# Isolate code so that e.g. setup doesn't cause different code to be generated by e.g. changing register allocation
659-
# Unfortunately it still does, e.g. if you define a variable in setup then it's passed into invocation adding a few instructions
660656
__prehook_result, __posthook_result, __return_val = $BenchmarkTools.@noinline (
661657
function (__evals)
662658
prehook_result = __params.prehook()
@@ -666,7 +662,6 @@ function generate_benchmark_definition(
666662
$BenchmarkTools.@noinline $(invocation)
667663
end
668664
posthook_result = __params.posthook()
669-
# trick the compiler not to eliminate the code
670665
return prehook_result, posthook_result, __return_val_2
671666
end
672667
)(

src/parameters.jl

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -244,16 +244,8 @@ function Parameters(
244244
else
245245
default.sample_result
246246
end
247-
params_prehook = if prehook != nothing
248-
prehook
249-
else
250-
default.prehook
251-
end
252-
params_posthook = if posthook != nothing
253-
posthook
254-
else
255-
default.posthook
256-
end
247+
params_prehook = prehook != nothing ? prehook : default.prehook
248+
params_posthook = posthook != nothing ? posthook : default.posthook
257249
return Parameters(
258250
params_seconds,
259251
params_samples,

0 commit comments

Comments
 (0)