OLD | NEW |
1 ''' | 1 ''' |
2 Created on May 19, 2011 | 2 Created on May 19, 2011 |
3 | 3 |
4 @author: bungeman | 4 @author: bungeman |
5 ''' | 5 ''' |
6 | 6 |
7 import re | 7 import re |
8 import math | 8 import math |
9 | 9 |
10 # bench representation algorithm constant names | 10 # bench representation algorithm constant names |
11 ALGORITHM_AVERAGE = 'avg' | 11 ALGORITHM_AVERAGE = 'avg' |
12 ALGORITHM_MEDIAN = 'med' | 12 ALGORITHM_MEDIAN = 'med' |
13 ALGORITHM_MINIMUM = 'min' | 13 ALGORITHM_MINIMUM = 'min' |
14 ALGORITHM_25TH_PERCENTILE = '25th' | 14 ALGORITHM_25TH_PERCENTILE = '25th' |
15 | 15 |
16 # Regular expressions used throughout | 16 # Regular expressions used throughout |
17 PER_SETTING_RE = '([^\s=]+)(?:=(\S+))?' | 17 PER_SETTING_RE = '([^\s=]+)(?:=(\S+))?' |
18 SETTINGS_RE = 'skia bench:((?:\s+' + PER_SETTING_RE + ')*)' | 18 SETTINGS_RE = 'skia bench:((?:\s+' + PER_SETTING_RE + ')*)' |
19 BENCH_RE = 'running bench (?:\[\d+ \d+\] )?\s*(\S+)' | 19 BENCH_RE = 'running bench (?:\[\d+ \d+\] )?\s*(\S+)' |
20 TIME_RE = '(?:(\w*)msecs = )?\s*((?:\d+\.\d+)(?:,\d+\.\d+)*)' | 20 TIME_RE = '(?:(\w*)msecs = )?\s*((?:\d+\.\d+)(?:, \d+\.\d+)*)' |
21 # non-per-tile benches have configs that don't end with ']' or '>' | 21 # non-per-tile benches have configs that don't end with ']' or '>' |
22 CONFIG_RE = '(\S+[^\]>]): ((?:' + TIME_RE + '\s+)+)' | 22 CONFIG_RE = '(\S+[^\]>]): ((?:' + TIME_RE + '\s+)+)' |
23 # per-tile bench lines are in the following format. Note that there are | 23 # per-tile bench lines are in the following format. Note that there are |
24 # non-averaged bench numbers in separate lines, which we ignore now due to | 24 # non-averaged bench numbers in separate lines, which we ignore now due to |
25 # their inaccuracy. | 25 # their inaccuracy. |
26 TILE_RE = (' tile_(\S+): tile \[\d+,\d+\] out of \[\d+,\d+\] <averaged>:' | 26 TILE_RE = (' tile_(\S+): tile \[\d+,\d+\] out of \[\d+,\d+\] <averaged>:' |
27 ' ((?:' + TIME_RE + '\s+)+)') | 27 ' ((?:' + TIME_RE + '\s+)+)') |
28 # for extracting tile layout | 28 # for extracting tile layout |
29 TILE_LAYOUT_RE = ' out of \[(\d+),(\d+)\] <averaged>: ' | 29 TILE_LAYOUT_RE = ' out of \[(\d+),(\d+)\] <averaged>: ' |
30 | 30 |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 """ | 289 """ |
290 return '<a href="http://code.google.com/p/skia/source/detail?r=%s">%s</a>'%( | 290 return '<a href="http://code.google.com/p/skia/source/detail?r=%s">%s</a>'%( |
291 revision_number, revision_number) | 291 revision_number, revision_number) |
292 | 292 |
293 def main(): | 293 def main(): |
294 foo = [[0.0, 0.0], [0.0, 1.0], [0.0, 2.0], [0.0, 3.0]] | 294 foo = [[0.0, 0.0], [0.0, 1.0], [0.0, 2.0], [0.0, 3.0]] |
295 LinearRegression(foo) | 295 LinearRegression(foo) |
296 | 296 |
297 if __name__ == "__main__": | 297 if __name__ == "__main__": |
298 main() | 298 main() |
OLD | NEW |