From 0b4c3fcae0748edb7ccb167237a7af165b966059 Mon Sep 17 00:00:00 2001 From: Paul Ferrand Date: Fri, 29 May 2020 10:05:27 +0200 Subject: [PATCH] Add padding to the benchmarks --- benchmarks/BM_interpolators.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/benchmarks/BM_interpolators.cpp b/benchmarks/BM_interpolators.cpp index 5935a6de..6fab4df9 100644 --- a/benchmarks/BM_interpolators.cpp +++ b/benchmarks/BM_interpolators.cpp @@ -4,6 +4,7 @@ // license. You should have receive a LICENSE.md file along with the code. // If not, contact the sfizz maintainers at https://github.com/sfztools/sfizz +#include "Config.h" #include "Interpolators.h" #include "ScopedFTZ.h" #include "absl/types/span.h" @@ -46,7 +47,8 @@ static void doInterpolation(absl::Span input, absl::Span out { const float kOutToIn = static_cast(input.size()) / output.size(); - for (size_t iOut = 0; iOut < output.size(); ++iOut) { + for (size_t iOut = sfz::config::excessFileFrames; + iOut < output.size() - sfz::config::excessFileFrames; ++iOut) { float posIn = iOut * kOutToIn; unsigned dec = static_cast(posIn); float frac = posIn - dec; @@ -81,6 +83,6 @@ BENCHMARK_DEFINE_F(Interpolators, Bspline3)(benchmark::State& state) } } -BENCHMARK_REGISTER_F(Interpolators, Linear)->RangeMultiplier(4)->Range(1 << 2, 1 << 12); -BENCHMARK_REGISTER_F(Interpolators, Hermite3)->RangeMultiplier(4)->Range(1 << 2, 1 << 12); -BENCHMARK_REGISTER_F(Interpolators, Bspline3)->RangeMultiplier(4)->Range(1 << 2, 1 << 12); +BENCHMARK_REGISTER_F(Interpolators, Linear)->RangeMultiplier(4)->Range(1 << 4, 1 << 12); +BENCHMARK_REGISTER_F(Interpolators, Hermite3)->RangeMultiplier(4)->Range(1 << 4, 1 << 12); +BENCHMARK_REGISTER_F(Interpolators, Bspline3)->RangeMultiplier(4)->Range(1 << 4, 1 << 12);