Performance experiment: Disable SkSL optimization in nanobench/skpbench

Cloned from http://review.skia.org/369716
Re-running the experiment now that @switch is supported when
optimizations are disabled.

Change-Id: I428051d9c679a8084589fba428a637f36587be16
Bug: skia:11341
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/374516
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This commit is contained in:
John Stiles 2021-02-23 16:39:55 -05:00
parent 8f8e7335a5
commit b34a896c12
3 changed files with 9 additions and 1 deletions

View File

@ -65,6 +65,7 @@ extern bool gSkForceRasterPipelineBlitter;
extern bool gUseSkVMBlitter;
extern bool gSkVMAllowJIT;
extern bool gSkVMJITViaDylib;
extern bool gSkSLAllowOptimization;
#ifndef SK_BUILD_FOR_WIN
#include <unistd.h>
@ -1240,6 +1241,7 @@ int main(int argc, char** argv) {
gSkForceRasterPipelineBlitter = FLAGS_forceRasterPipeline;
gUseSkVMBlitter = FLAGS_skvm;
gSkVMAllowJIT = gSkVMJITViaDylib = FLAGS_jit;
gSkSLAllowOptimization = false; // Temporary experiment
int runs = 0;
BenchmarkStream benchStream;

View File

@ -70,6 +70,8 @@
#endif
bool gSkSLAllowOptimization = true;
namespace SkSL {
using RefKind = VariableReference::RefKind;
@ -1474,7 +1476,7 @@ std::unique_ptr<Program> Compiler::convertProgram(
bool success = false;
if (fErrorCount) {
// Do not return programs that failed to compile.
} else if (settings.fOptimize && !this->optimize(*program)) {
} else if (settings.fOptimize && gSkSLAllowOptimization && !this->optimize(*program)) {
// Do not return programs that failed to optimize.
} else {
// We have a successful program!

View File

@ -88,6 +88,8 @@ static const char resultFormat[] =
static constexpr int kNumFlushesToPrimeCache = 3;
extern bool gSkSLAllowOptimization;
struct Sample {
using duration = std::chrono::nanoseconds;
@ -496,6 +498,8 @@ int main(int argc, char** argv) {
exit(0); // This can be used to print the header and quit.
}
gSkSLAllowOptimization = false; // Temporary experiment
// Parse the config.
const SkCommandLineConfigGpu* config = nullptr; // Initialize for spurious warning.
SkCommandLineConfigArray configs;