From aff96361d3936e34a270f93ca11d0cf868239517 Mon Sep 17 00:00:00 2001 From: phoglund Date: Wed, 30 Nov 2016 05:04:39 -0800 Subject: [PATCH] Greatly reduce number of level controller tests. These tests have been causing a large number of false alerts, which is tons of work for the perf sheriff. It's infeasible to test every single permutation, so we must choose carefully. This CL reduces the number of RESULT lines from the test from ~450 to ~50. I attempted to choose interesting permutations, but you probably know better what's interesting... https://chromeperf.appspot.com/report? sid=a7193c96f708018848ca07ad9c78ac657cadab3c70b3939c42bd7d70a092d61a also suggests most of the metrics have enormous standard deviations, so maybe you could look into how stable the metrics really are and remove/stabilize the ones that aren't? BUG=chromium:666725 Review-Url: https://codereview.webrtc.org/2529393006 Cr-Commit-Position: refs/heads/master@{#15329} --- .../level_controller_complexity_unittest.cc | 66 ++++++++++--------- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/webrtc/modules/audio_processing/level_controller/level_controller_complexity_unittest.cc b/webrtc/modules/audio_processing/level_controller/level_controller_complexity_unittest.cc index 122a57c7b0..a59ef98612 100644 --- a/webrtc/modules/audio_processing/level_controller/level_controller_complexity_unittest.cc +++ b/webrtc/modules/audio_processing/level_controller/level_controller_complexity_unittest.cc @@ -184,25 +184,40 @@ TEST(LevelControllerPerformanceTest, StandaloneProcessing) { } } +void TestSomeSampleRatesWithApm(const std::string& test_name, + bool use_mobile_agc, + bool include_default_apm_processing) { + // Test some stereo combinations first. + size_t num_channels = 2; + RunTogetherWithApm(test_name, 48000, 48000, AudioProcessing::kSampleRate8kHz, + AudioProcessing::kSampleRate48kHz, num_channels, + use_mobile_agc, include_default_apm_processing); + RunTogetherWithApm(test_name, 48000, 48000, AudioProcessing::kSampleRate16kHz, + AudioProcessing::kSampleRate32kHz, num_channels, + use_mobile_agc, include_default_apm_processing); + RunTogetherWithApm(test_name, 48000, 48000, AudioProcessing::kSampleRate32kHz, + AudioProcessing::kSampleRate16kHz, num_channels, + use_mobile_agc, include_default_apm_processing); + RunTogetherWithApm(test_name, 48000, 48000, AudioProcessing::kSampleRate48kHz, + AudioProcessing::kSampleRate8kHz, num_channels, + use_mobile_agc, include_default_apm_processing); + RunTogetherWithApm(test_name, 48000, 48000, 44100, 44100, num_channels, + use_mobile_agc, include_default_apm_processing); + + // Then test mono combinations. + num_channels = 1; + RunTogetherWithApm(test_name, 48000, 48000, AudioProcessing::kSampleRate48kHz, + AudioProcessing::kSampleRate48kHz, num_channels, + use_mobile_agc, include_default_apm_processing); +} + #if !defined(WEBRTC_ANDROID) TEST(LevelControllerPerformanceTest, ProcessingViaApm) { #else TEST(LevelControllerPerformanceTest, DISABLED_ProcessingViaApm) { #endif - int sample_rates_to_test[] = {AudioProcessing::kSampleRate8kHz, - AudioProcessing::kSampleRate16kHz, - AudioProcessing::kSampleRate32kHz, - AudioProcessing::kSampleRate48kHz, 44100}; - for (auto capture_input_sample_rate_hz : sample_rates_to_test) { - for (auto capture_output_sample_rate_hz : sample_rates_to_test) { - for (size_t num_channels = 1; num_channels <= 2; ++num_channels) { - RunTogetherWithApm("SimpleLevelControlViaApm", 48000, 48000, - capture_input_sample_rate_hz, - capture_output_sample_rate_hz, num_channels, false, - false); - } - } - } + // Run without default APM processing and desktop AGC. + TestSomeSampleRatesWithApm("SimpleLevelControlViaApm", false, false); } #if !defined(WEBRTC_ANDROID) @@ -210,24 +225,11 @@ TEST(LevelControllerPerformanceTest, InteractionWithDefaultApm) { #else TEST(LevelControllerPerformanceTest, DISABLED_InteractionWithDefaultApm) { #endif - int sample_rates_to_test[] = {AudioProcessing::kSampleRate8kHz, - AudioProcessing::kSampleRate16kHz, - AudioProcessing::kSampleRate32kHz, - AudioProcessing::kSampleRate48kHz, 44100}; - for (auto capture_input_sample_rate_hz : sample_rates_to_test) { - for (auto capture_output_sample_rate_hz : sample_rates_to_test) { - for (size_t num_channels = 1; num_channels <= 2; ++num_channels) { - RunTogetherWithApm("LevelControlAndDefaultDesktopApm", 48000, 48000, - capture_input_sample_rate_hz, - capture_output_sample_rate_hz, num_channels, false, - true); - RunTogetherWithApm("LevelControlAndDefaultMobileApm", 48000, 48000, - capture_input_sample_rate_hz, - capture_output_sample_rate_hz, num_channels, true, - true); - } - } - } + bool include_default_apm_processing = true; + TestSomeSampleRatesWithApm("LevelControlAndDefaultDesktopApm", false, + include_default_apm_processing); + TestSomeSampleRatesWithApm("LevelControlAndDefaultMobileApm", true, + include_default_apm_processing); } } // namespace webrtc