Remove dashing from gpu veto
With new veto our new veto test results look like the following:
TP: true positive (picked to use gpu and gpu was faster)
I: inderminate, the raster time is withing 5% of gpu time
TP FP TN FN I
old 21 9 15 12 3
new 29 12 11 6 3
There are three skps that tend to move from TN -> FP, however
the absolute difference in their run times are not huge between
them. The largest being desk_booking which is about 7.1 raster
and 8.8 gpu. The other two skps are desk_yahooanswers and
desk_linkedin
BUG=skia:
R=bsalomon@google.com, robertphillips@google.com
Author: egdaniel@google.com
Review URL: https://codereview.chromium.org/334053005
diff --git a/tools/test_gpuveto.py b/tools/test_gpuveto.py
old mode 100644
new mode 100755
index 2116179..fbb29ae
--- a/tools/test_gpuveto.py
+++ b/tools/test_gpuveto.py
@@ -57,9 +57,11 @@
def __init__(self):
self.bench_pictures = find_run_binary.find_path_to_program(
'bench_pictures')
+ sys.stdout.write('Running: %s\n' % (self.bench_pictures))
self.gpuveto = find_run_binary.find_path_to_program('gpuveto')
assert os.path.isfile(self.bench_pictures)
assert os.path.isfile(self.gpuveto)
+ self.indeterminate = 0
self.truePositives = 0
self.falsePositives = 0
self.trueNegatives = 0
@@ -69,14 +71,16 @@
for skp in enumerate(dir_or_file):
self.process_skp(skp[1])
- sys.stdout.write('TP %d FP %d TN %d FN %d\n' % (self.truePositives,
- self.falsePositives,
- self.trueNegatives,
- self.falseNegatives))
+ sys.stdout.write('TP %d FP %d TN %d FN %d IND %d\n' % (self.truePositives,
+ self.falsePositives,
+ self.trueNegatives,
+ self.falseNegatives,
+ self.indeterminate))
def process_skp(self, skp_file):
assert os.path.isfile(skp_file)
+ #print skp_file
# run gpuveto on the skp
args = [self.gpuveto, '-r', skp_file]
@@ -92,46 +96,63 @@
# run raster config
args = [self.bench_pictures, '-r', skp_file,
- '--repeat', '20',
+ '--repeat', '20',
+ '--timers', 'w',
'--config', '8888']
returncode, output = execute_program(args)
if (returncode != 0):
return
- matches = re.findall('[\d.]+', output)
- if len(matches) != 4:
+ matches = re.findall('[\d]+\.[\d]+', output)
+ if len(matches) != 1:
return
- rasterTime = float(matches[3])
+ rasterTime = float(matches[0])
# run gpu config
args2 = [self.bench_pictures, '-r', skp_file,
- '--repeat', '20',
+ '--repeat', '20',
+ '--timers', 'w',
'--config', 'gpu']
returncode, output = execute_program(args2)
if (returncode != 0):
return
- matches = re.findall('[\d.]+', output)
- if len(matches) != 4:
+ matches = re.findall('[\d]+\.[\d]+', output)
+ if len(matches) != 1:
return
- gpuTime = float(matches[3])
+ gpuTime = float(matches[0])
- sys.stdout.write('%s: gpuveto: %d raster %.2f gpu: %.2f\n' % (
- skp_file, suitable, rasterTime, gpuTime))
+ # happens if page is too big it will not render
+ if 0 == gpuTime:
+ return
- if suitable:
+ tolerance = 0.05
+ tol_range = tolerance * gpuTime
+
+
+ if rasterTime > gpuTime - tol_range and rasterTime < gpuTime + tol_range:
+ result = "NONE"
+ self.indeterminate += 1
+ elif suitable:
if gpuTime < rasterTime:
self.truePositives += 1
+ result = "TP"
else:
self.falsePositives += 1
+ result = "FP"
else:
if gpuTime < rasterTime:
self.falseNegatives += 1
+ result = "FN"
else:
self.trueNegatives += 1
+ result = "TN"
+
+ sys.stdout.write('%s: gpuveto: %d raster %.2f gpu: %.2f Result: %s\n' % (
+ skp_file, suitable, rasterTime, gpuTime, result))
def main(main_argv):
parser = argparse.ArgumentParser()