Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be found | 3 # Use of this source code is governed by a BSD-style license that can be found |
| 4 # in the LICENSE file. | 4 # in the LICENSE file. |
| 5 | 5 |
| 6 """ Analyze recent SkPicture bench data, and output suggested ranges. | 6 """ Analyze recent SkPicture bench data, and output suggested ranges. |
| 7 | 7 |
| 8 The outputs can be edited and pasted to bench_expectations.txt to trigger | 8 The outputs can be edited and pasted to bench_expectations.txt to trigger |
| 9 buildbot alerts if the actual benches are out of range. Details are documented | 9 buildbot alerts if the actual benches are out of range. Details are documented |
| 10 in the .txt file. | 10 in the .txt file. |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 33 | 33 |
| 34 # Ratios for calculating suggested picture bench upper and lower bounds. | 34 # Ratios for calculating suggested picture bench upper and lower bounds. |
| 35 BENCH_UB = 1.1 # Allow for 10% room for normal variance on the up side. | 35 BENCH_UB = 1.1 # Allow for 10% room for normal variance on the up side. |
| 36 BENCH_LB = 0.9 | 36 BENCH_LB = 0.9 |
| 37 | 37 |
| 38 # Further allow for a fixed amount of noise. This is especially useful for | 38 # Further allow for a fixed amount of noise. This is especially useful for |
| 39 # benches of smaller absolute value. Keeping this value small will not affect | 39 # benches of smaller absolute value. Keeping this value small will not affect |
| 40 # performance tunings. | 40 # performance tunings. |
| 41 BENCH_ALLOWED_NOISE = 10 | 41 BENCH_ALLOWED_NOISE = 10 |
| 42 | 42 |
| 43 # Name prefix for benchmark builders. | |
| 44 BENCH_BUILDER_PREFIX = 'Perf-' | |
| 45 | |
| 43 # List of platforms to track. Feel free to change it to meet your needs. | 46 # List of platforms to track. Feel free to change it to meet your needs. |
| 44 PLATFORMS = ['MacMini_10_8_Float_Bench_32', | 47 PLATFORMS = ['Perf-Mac10.8-MacMini4.1-GeForce320M-x86-Release', |
| 45 'Nexus7_4-1_Float_Bench_32', | 48 'Perf-Android-Nexus7-Tegra3-Arm7-Release', |
| 46 'Shuttle_Ubuntu12_ATI5770_Float_Bench_32', | 49 'Perf-Ubuntu12-ShuttleA-ATI5770-x86-Release', |
| 47 'Shuttle_Win7_Intel_Float_Bench_32', | 50 'Perf-Win7-ShuttleA-HD2000-x86-Release', |
| 48 ] | 51 ] |
| 49 | 52 |
| 50 # Filter for configs of no interest. They are old config names replaced by more | 53 # Filter for configs of no interest. They are old config names replaced by more |
| 51 # specific ones. | 54 # specific ones. |
| 52 CONFIGS_TO_FILTER = ['gpu', 'raster'] | 55 CONFIGS_TO_FILTER = ['gpu', 'raster'] |
| 53 | 56 |
| 54 # Template for gsutil uri. | 57 # Template for gsutil uri. |
| 55 GOOGLE_STORAGE_URI_SCHEME = 'gs' | 58 GOOGLE_STORAGE_URI_SCHEME = 'gs' |
| 56 URI_BUCKET = 'chromium-skia-gm' | 59 URI_BUCKET = 'chromium-skia-gm' |
| 57 | 60 |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 87 | 90 |
| 88 Ignores data with revisions outside [rev_min, rev_max] integer range. For | 91 Ignores data with revisions outside [rev_min, rev_max] integer range. For |
| 89 bench data with multiple revisions, we use higher revisions to calculate | 92 bench data with multiple revisions, we use higher revisions to calculate |
| 90 expected bench values. | 93 expected bench values. |
| 91 Uses the provided representation_alg for calculating bench representations. | 94 Uses the provided representation_alg for calculating bench representations. |
| 92 """ | 95 """ |
| 93 expectation_dic = {} | 96 expectation_dic = {} |
| 94 uri = boto.storage_uri(URI_BUCKET, GOOGLE_STORAGE_URI_SCHEME) | 97 uri = boto.storage_uri(URI_BUCKET, GOOGLE_STORAGE_URI_SCHEME) |
| 95 for obj in uri.get_bucket(): | 98 for obj in uri.get_bucket(): |
| 96 # Filters out non-skp-bench files. | 99 # Filters out non-skp-bench files. |
| 97 if ((not obj.name.startswith('perfdata/Skia_') and | 100 if ((not obj.name.startswith('perfdata/%s' % BENCH_BUILDER_PREFIX) and |
| 98 not obj.name.startswith('playback/perfdata/Skia_')) or | 101 not obj.name.startswith( |
| 102 'playback/perfdata/%s' % BENCH_BUILDER_PREFIX)) or | |
| 99 obj.name.find('_data_skp_') < 0): | 103 obj.name.find('_data_skp_') < 0): |
| 100 continue | 104 continue |
| 101 # Ignores uninterested platforms. | 105 # Ignores uninterested platforms. |
| 102 platform = obj.name.split('/')[1] | 106 platform = obj.name.split('/')[1] |
| 103 if not platform.startswith('Skia_'): | 107 if not platform.startswith(BENCH_BUILDER_PREFIX): |
| 104 platform = obj.name.split('/')[2] | 108 platform = obj.name.split('/')[2] |
| 105 if not platform.startswith('Skia_'): | 109 if not platform.startswith(BENCH_BUILDER_PREFIX): |
| 106 continue # Ignores non-platform object | 110 continue # Ignores non-platform object |
| 107 platform = platform[5:] # Removes "Skia_" prefix. | |
|
rmistry
2013/04/29 20:44:31
Food for thought:
The advantage of this step which
borenet
2013/04/29 20:54:09
I don't like having builder names modified anywher
| |
| 108 if platform not in PLATFORMS: | 111 if platform not in PLATFORMS: |
| 109 continue | 112 continue |
| 110 # Filters by revision. | 113 # Filters by revision. |
| 111 to_filter = True | 114 to_filter = True |
| 112 for rev in range(rev_min, rev_max + 1): | 115 for rev in range(rev_min, rev_max + 1): |
| 113 if '_r%s_' % rev in obj.name: | 116 if '_r%s_' % rev in obj.name: |
| 114 to_filter = False | 117 to_filter = False |
| 115 break | 118 break |
| 116 if to_filter: | 119 if to_filter: |
| 117 continue | 120 continue |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 154 else: | 157 else: |
| 155 rev_min = int(range_match.group(1)) | 158 rev_min = int(range_match.group(1)) |
| 156 rev_max = int(range_match.group(2)) | 159 rev_max = int(range_match.group(2)) |
| 157 OutputSkpBenchExpectations(rev_min, rev_max, options.alg) | 160 OutputSkpBenchExpectations(rev_min, rev_max, options.alg) |
| 158 else: | 161 else: |
| 159 parser.error('Please provide mandatory flag %s' % OPTION_REVISION_RANGE) | 162 parser.error('Please provide mandatory flag %s' % OPTION_REVISION_RANGE) |
| 160 | 163 |
| 161 | 164 |
| 162 if '__main__' == __name__: | 165 if '__main__' == __name__: |
| 163 main() | 166 main() |
| OLD | NEW |