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

Side by Side Diff: tools/testing/perf_testing/run_perf_tests.py

Issue 10012046: Normalize droameo benchmarks to legal filenames in perf runner script (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix name on parsing Created 8 years, 8 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 | « tools/testing/perf_testing/dromaeo.html ('k') | 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 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
4 # for details. All rights reserved. Use of this source code is governed by a 4 # for details. All rights reserved. Use of this source code is governed by a
5 # BSD-style license that can be found in the LICENSE file. 5 # BSD-style license that can be found in the LICENSE file.
6 6
7 import datetime 7 import datetime
8 import getpass 8 import getpass
9 import math 9 import math
10 try: 10 try:
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 'getElementsByName', 579 'getElementsByName',
580 'getElementsByName (not in document)']), 580 'getElementsByName (not in document)']),
581 'traverse': ('traverse', [ 581 'traverse': ('traverse', [
582 'firstChild', 582 'firstChild',
583 'lastChild', 583 'lastChild',
584 'nextSibling', 584 'nextSibling',
585 'previousSibling', 585 'previousSibling',
586 'childNodes']) 586 'childNodes'])
587 } 587 }
588 588
589 # Use legal appengine filenames for benchmark names.
590 def legalize_filename(str):
591 remap = {
592 ' ': '_',
593 '(': '_',
594 ')': '_',
595 '*': 'ALL',
596 '=': 'ASSIGN',
597 }
598 for (old, new) in remap.iteritems():
599 str = str.replace(old, new)
600 return str
601
589 # TODO(vsm): This is a hack to skip breaking tests. Triage this 602 # TODO(vsm): This is a hack to skip breaking tests. Triage this
590 # failure properly. The modify suite fails on 32-bit chrome on 603 # failure properly. The modify suite fails on 32-bit chrome on
591 # the mac. 604 # the mac.
592 def get_valid_dromaeo_tags(): 605 def get_valid_dromaeo_tags():
593 tags = [tag for (tag, _) in DROMAEO_BENCHMARKS.values()] 606 tags = [tag for (tag, _) in DROMAEO_BENCHMARKS.values()]
594 if platform.system() == 'Darwin': 607 if platform.system() == 'Darwin':
595 tags.remove('modify') 608 tags.remove('modify')
596 return tags 609 return tags
597 610
598 def get_dromaeo_benchmarks(): 611 def get_dromaeo_benchmarks():
599 valid = get_valid_dromaeo_tags() 612 valid = get_valid_dromaeo_tags()
600 benchmarks = reduce(lambda l1,l2: l1+l2, 613 benchmarks = reduce(lambda l1,l2: l1+l2,
601 [tests for (tag, tests) in 614 [tests for (tag, tests) in
602 DROMAEO_BENCHMARKS.values() if tag in valid]) 615 DROMAEO_BENCHMARKS.values() if tag in valid])
603 return map(lambda str: str.replace(' ', '_'), benchmarks) 616 return map(legalize_filename, benchmarks)
604 617
605 def get_dromaeo_versions(): 618 def get_dromaeo_versions():
606 return ['js', 'frog_dom', 'frog_html'] 619 return ['js', 'frog_dom', 'frog_html']
607 620
608 def get_dromaeo_url_query(version): 621 def get_dromaeo_url_query(version):
609 version = version.replace('_','&') 622 version = version.replace('_','&')
610 tags = get_valid_dromaeo_tags() 623 tags = get_valid_dromaeo_tags()
611 return '|'.join([ '%s&%s' % (version, tag) for tag in tags]) 624 return '|'.join([ '%s&%s' % (version, tag) for tag in tags])
612 625
613 class DromaeoTest(PerformanceTest): 626 class DromaeoTest(PerformanceTest):
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 revision_num = int(rev.group(1)) 678 revision_num = int(rev.group(1))
666 continue 679 continue
667 680
668 suite_results = re.findall(suite_pattern, line) 681 suite_results = re.findall(suite_pattern, line)
669 if suite_results: 682 if suite_results:
670 for suite_result in suite_results: 683 for suite_result in suite_results:
671 results = re.findall(r'<li>(.*?)</li>', suite_result) 684 results = re.findall(r'<li>(.*?)</li>', suite_result)
672 if results: 685 if results:
673 for result in results: 686 for result in results:
674 r = re.match(result_pattern, result) 687 r = re.match(result_pattern, result)
675 name = r.group(1).strip(':').replace(' ', '_') 688 name = legalize_filename(r.group(1).strip(':'))
676 score = float(r.group(2)) 689 score = float(r.group(2))
677 bench_dict[name] += [float(score)] 690 bench_dict[name] += [float(score)]
678 self.revision_dict[browser][version][name] += [revision_num] 691 self.revision_dict[browser][version][name] += [revision_num]
679 692
680 f.close() 693 f.close()
681 self.calculate_geometric_mean(browser, version, revision_num) 694 self.calculate_geometric_mean(browser, version, revision_num)
682 695
683 696
684 class DromaeoSizeTest(TestRunner): 697 class DromaeoSizeTest(TestRunner):
685 """Run tests to determine the compiled file output size of Dromaeo.""" 698 """Run tests to determine the compiled file output size of Dromaeo."""
686 def __init__(self): 699 def __init__(self):
687 super(DromaeoSizeTest, self).__init__( 700 super(DromaeoSizeTest, self).__init__(
688 DROMAEO_SIZE, 701 DROMAEO_SIZE,
689 ['browser'], ['dart', 'frog_dom', 'frog_html', 'frog_htmlidiomatic'], 702 ['browser'], ['dart', 'frog_dom', 'frog_html', 'frog_htmlidiomatic'],
690 DROMAEO_BENCHMARKS.keys()) 703 DROMAEO_BENCHMARKS.keys())
691 704
692 def run_tests(self): 705 def run_tests(self):
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
967 while True: 980 while True:
968 if has_new_code(): 981 if has_new_code():
969 run_test_sequence(suites, no_build, graph_only, upload) 982 run_test_sequence(suites, no_build, graph_only, upload)
970 else: 983 else:
971 time.sleep(SLEEP_TIME) 984 time.sleep(SLEEP_TIME)
972 else: 985 else:
973 run_test_sequence(suites, no_build, graph_only, upload) 986 run_test_sequence(suites, no_build, graph_only, upload)
974 987
975 if __name__ == '__main__': 988 if __name__ == '__main__':
976 main() 989 main()
OLDNEW
« no previous file with comments | « tools/testing/perf_testing/dromaeo.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698