Commit 69e3e098 authored by Caleb Rouleau's avatar Caleb Rouleau Committed by Commit Bot

[media_perftests] Filter out unoptimized and unaligned tests.

We don't care about the performance of these, so it's best not
to run them at all.

This change has two parts:
1. Split unoptimized tests into separate test cases so that they can
be filtered separately.
2. Add the filter for them to the gn_isolate_map so that swarming jobs
will filter them out.

Bug: 767124
Change-Id: Ia7b9a44f202346aec051280043756ea5d1d716e7
Reviewed-on: https://chromium-review.googlesource.com/835354Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Reviewed-by: default avatarJohn Rummell <jrummell@chromium.org>
Commit-Queue: Caleb Rouleau <crouleau@chromium.org>
Cr-Commit-Position: refs/heads/master@{#525228}
parent bea24c08
......@@ -85,7 +85,9 @@ class MEDIA_EXPORT SincResampler {
private:
FRIEND_TEST_ALL_PREFIXES(SincResamplerTest, Convolve);
FRIEND_TEST_ALL_PREFIXES(SincResamplerPerfTest, Convolve);
FRIEND_TEST_ALL_PREFIXES(SincResamplerPerfTest, Convolve_unoptimized_aligned);
FRIEND_TEST_ALL_PREFIXES(SincResamplerPerfTest, Convolve_optimized_aligned);
FRIEND_TEST_ALL_PREFIXES(SincResamplerPerfTest, Convolve_optimized_unaligned);
void InitializeKernel();
void UpdateRegions(bool second_load);
......
......@@ -29,16 +29,17 @@ static void DoNothing(int frames, float* destination) {}
#endif
static void RunConvolveBenchmark(
SincResampler* resampler,
float (*convolve_fn)(const float*, const float*, const float*, double),
bool aligned,
const std::string& trace_name) {
SincResampler resampler(kSampleRateRatio, SincResampler::kDefaultRequestSize,
base::BindRepeating(&DoNothing));
base::TimeTicks start = base::TimeTicks::Now();
for (int i = 0; i < kBenchmarkIterations; ++i) {
convolve_fn(resampler->get_kernel_for_testing() + (aligned ? 0 : 1),
resampler->get_kernel_for_testing(),
resampler->get_kernel_for_testing(),
kKernelInterpolationFactor);
convolve_fn(resampler.get_kernel_for_testing() + (aligned ? 0 : 1),
resampler.get_kernel_for_testing(),
resampler.get_kernel_for_testing(), kKernelInterpolationFactor);
}
double total_time_milliseconds =
(base::TimeTicks::Now() - start).InMillisecondsF();
......@@ -52,22 +53,21 @@ static void RunConvolveBenchmark(
// Benchmark for the various Convolve() methods. Make sure to build with
// branding=Chrome so that DCHECKs are compiled out when benchmarking.
TEST(SincResamplerPerfTest, Convolve) {
SincResampler resampler(kSampleRateRatio,
SincResampler::kDefaultRequestSize,
base::Bind(&DoNothing));
RunConvolveBenchmark(
&resampler, SincResampler::Convolve_C, true, "unoptimized_aligned");
TEST(SincResamplerPerfTest, Convolve_unoptimized_aligned) {
RunConvolveBenchmark(SincResampler::Convolve_C, true, "unoptimized_aligned");
}
#if defined(CONVOLVE_FUNC)
RunConvolveBenchmark(
&resampler, SincResampler::CONVOLVE_FUNC, true, "optimized_aligned");
RunConvolveBenchmark(
&resampler, SincResampler::CONVOLVE_FUNC, false, "optimized_unaligned");
#endif
TEST(SincResamplerPerfTest, Convolve_optimized_aligned) {
RunConvolveBenchmark(SincResampler::CONVOLVE_FUNC, true, "optimized_aligned");
}
TEST(SincResamplerPerfTest, Convolve_optimized_unaligned) {
RunConvolveBenchmark(SincResampler::CONVOLVE_FUNC, false,
"optimized_unaligned");
}
#endif
#undef CONVOLVE_FUNC
} // namespace media
......@@ -93,67 +93,85 @@ class VectorMathPerfTest : public testing::Test {
#define EWMAAndMaxPower_FUNC EWMAAndMaxPower_NEON
#endif
// Benchmark for each optimized vector_math::FMAC() method.
TEST_F(VectorMathPerfTest, FMAC) {
// Benchmark FMAC_C().
// Benchmarks for each optimized vector_math::FMAC() method.
// Benchmark FMAC_C().
TEST_F(VectorMathPerfTest, FMAC_unoptimized) {
RunBenchmark(
vector_math::FMAC_C, true, "vector_math_fmac", "unoptimized");
}
#if defined(FMAC_FUNC)
// Benchmark FMAC_FUNC() with unaligned size.
// Benchmark FMAC_FUNC() with unaligned size.
TEST_F(VectorMathPerfTest, FMAC_optimized_unaligned) {
ASSERT_NE((kVectorSize - 1) % (vector_math::kRequiredAlignment /
sizeof(float)), 0U);
RunBenchmark(
vector_math::FMAC_FUNC, false, "vector_math_fmac", "optimized_unaligned");
// Benchmark FMAC_FUNC() with aligned size.
}
// Benchmark FMAC_FUNC() with aligned size.
TEST_F(VectorMathPerfTest, FMAC_optimized_aligned) {
ASSERT_EQ(kVectorSize % (vector_math::kRequiredAlignment / sizeof(float)),
0U);
RunBenchmark(
vector_math::FMAC_FUNC, true, "vector_math_fmac", "optimized_aligned");
#endif
}
#endif
// Benchmark for each optimized vector_math::FMUL() method.
TEST_F(VectorMathPerfTest, FMUL) {
// Benchmark FMUL_C().
// Benchmarks for each optimized vector_math::FMUL() method.
// Benchmark FMUL_C().
TEST_F(VectorMathPerfTest, FMUL_unoptimized) {
RunBenchmark(
vector_math::FMUL_C, true, "vector_math_fmul", "unoptimized");
}
#if defined(FMUL_FUNC)
// Benchmark FMUL_FUNC() with unaligned size.
// Benchmark FMUL_FUNC() with unaligned size.
TEST_F(VectorMathPerfTest, FMUL_optimized_unaligned) {
ASSERT_NE((kVectorSize - 1) % (vector_math::kRequiredAlignment /
sizeof(float)), 0U);
RunBenchmark(
vector_math::FMUL_FUNC, false, "vector_math_fmul", "optimized_unaligned");
// Benchmark FMUL_FUNC() with aligned size.
}
// Benchmark FMUL_FUNC() with aligned size.
TEST_F(VectorMathPerfTest, FMUL_optimized_aligned) {
ASSERT_EQ(kVectorSize % (vector_math::kRequiredAlignment / sizeof(float)),
0U);
RunBenchmark(
vector_math::FMUL_FUNC, true, "vector_math_fmul", "optimized_aligned");
#endif
}
#endif
// Benchmark for each optimized vector_math::EWMAAndMaxPower() method.
TEST_F(VectorMathPerfTest, EWMAAndMaxPower) {
// Benchmark EWMAAndMaxPower_C().
// Benchmarks for each optimized vector_math::EWMAAndMaxPower() method.
// Benchmark EWMAAndMaxPower_C().
TEST_F(VectorMathPerfTest, EWMAAndMaxPower_unoptimized) {
RunBenchmark(vector_math::EWMAAndMaxPower_C,
kVectorSize,
"vector_math_ewma_and_max_power",
"unoptimized");
}
#if defined(EWMAAndMaxPower_FUNC)
// Benchmark EWMAAndMaxPower_FUNC() with unaligned size.
// Benchmark EWMAAndMaxPower_FUNC() with unaligned size.
TEST_F(VectorMathPerfTest, EWMAAndMaxPower_optimized_unaligned) {
ASSERT_NE((kVectorSize - 1) % (vector_math::kRequiredAlignment /
sizeof(float)), 0U);
RunBenchmark(vector_math::EWMAAndMaxPower_FUNC,
kVectorSize - 1,
"vector_math_ewma_and_max_power",
"optimized_unaligned");
// Benchmark EWMAAndMaxPower_FUNC() with aligned size.
}
// Benchmark EWMAAndMaxPower_FUNC() with aligned size.
TEST_F(VectorMathPerfTest, EWMAAndMaxPower_optimized_aligned) {
ASSERT_EQ(kVectorSize % (vector_math::kRequiredAlignment / sizeof(float)),
0U);
RunBenchmark(vector_math::EWMAAndMaxPower_FUNC,
kVectorSize,
"vector_math_ewma_and_max_power",
"optimized_aligned");
#endif
}
#endif
} // namespace media
......@@ -1022,6 +1022,7 @@
"media_perftests",
"--single-process-tests",
"--test-launcher-retry-limit=0",
"--isolated-script-test-filter=*::-*_unoptimized::*_unaligned::*unoptimized_aligned",
],
},
"load_library_perf_tests": {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment