Bug 1263839: P2. Force re-run of VP9 benchmark based on a version check. r=kentuckyfriedtakahe

The version number is to be manually updated when we want to re-run the test (like improvement in ffvp9 or libvpx)

MozReview-Commit-ID: 9KzYCGWvIpp

--HG--
extra : rebase_source : a5c06065d3e174f3a4cb5ca0fbe2b08b8728f083
This commit is contained in:
Jean-Yves Avenard 2016-04-13 12:44:29 +10:00
Родитель f73e7a533f
Коммит 2d5d30672a
3 изменённых файлов: 12 добавлений и 1 удалений

Просмотреть файл

@ -5717,6 +5717,8 @@ ContentParent::RecvNotifyBenchmarkResult(const nsString& aCodecName,
{
if (aCodecName.EqualsLiteral("VP9")) {
Preferences::SetUint(VP9Benchmark::sBenchmarkFpsPref, aDecodeFPS);
Preferences::SetUint(VP9Benchmark::sBenchmarkFpsVersionCheck,
VP9Benchmark::sBenchmarkVersionID);
}
return true;
}

Просмотреть файл

@ -16,7 +16,12 @@
namespace mozilla {
// Update this version number to force re-running the benchmark. Such as when
// an improvement to FFVP9 or LIBVPX is deemed worthwhile.
const uint32_t VP9Benchmark::sBenchmarkVersionID = 1;
const char* VP9Benchmark::sBenchmarkFpsPref = "media.benchmark.vp9.fps";
const char* VP9Benchmark::sBenchmarkFpsVersionCheck = "media.benchmark.vp9.versioncheck";
bool VP9Benchmark::sHasRunTest = false;
bool
@ -25,8 +30,9 @@ VP9Benchmark::IsVP9DecodeFast()
MOZ_ASSERT(NS_IsMainThread());
bool hasPref = Preferences::HasUserValue(sBenchmarkFpsPref);
uint32_t hadRecentUpdate = Preferences::GetUint(sBenchmarkFpsVersionCheck, 0U);
if (!sHasRunTest && !hasPref) {
if (!sHasRunTest && (!hasPref || hadRecentUpdate != sBenchmarkVersionID)) {
sHasRunTest = true;
RefPtr<WebMDemuxer> demuxer =
@ -54,6 +60,7 @@ VP9Benchmark::IsVP9DecodeFast()
}
} else {
Preferences::SetUint(sBenchmarkFpsPref, aDecodeFps);
Preferences::SetUint(sBenchmarkFpsVersionCheck, sBenchmarkVersionID);
}
Telemetry::Accumulate(Telemetry::ID::VIDEO_VP9_BENCHMARK_FPS, aDecodeFps);
},

Просмотреть файл

@ -104,6 +104,8 @@ class VP9Benchmark
public:
static bool IsVP9DecodeFast();
static const char* sBenchmarkFpsPref;
static const char* sBenchmarkFpsVersionCheck;
static const uint32_t sBenchmarkVersionID;
static bool sHasRunTest;
};
}