Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(253)

Side by Side Diff: bench/bench_util.py

Issue 23069003: bench_util: allow optional whitespace in CSV format (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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+)(?:,\s*\d+\.\d+)*)'
epoger 2013/08/13 15:08:32 This seems to fix it. To test, I ran this command
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
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()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698