| Index: tools/testing/perf_testing/create_graph.py
|
| ===================================================================
|
| --- tools/testing/perf_testing/create_graph.py (revision 2479)
|
| +++ tools/testing/perf_testing/create_graph.py (working copy)
|
| @@ -33,10 +33,6 @@
|
| FROG = 'frog'
|
| V8_AND_FROG = [V8, FROG]
|
| CORRECTNESS = 'Percent passing'
|
| -BENCHMARKS = ['Mandelbrot', 'DeltaBlue', 'Richards', 'NBody',
|
| - 'BinaryTrees', 'Fannkuch', 'Meteor', 'BubbleSort', 'Fibonacci',
|
| - 'Loop', 'Permute', 'Queens', 'QuickSort', 'Recurse', 'Sieve', 'Sum',
|
| - 'Tak', 'Takl', 'Towers', 'TreeSort']
|
| COLORS = ['blue', 'green', 'red', 'cyan', 'magenta', 'black']
|
| GRAPH_OUT_DIR = 'graphs'
|
| SLEEP_TIME = 200
|
| @@ -60,7 +56,13 @@
|
| if append:
|
| mode = 'a'
|
| out = open(outfile, mode)
|
| - p = subprocess.Popen(cmd_list, stdout = out, stderr = subprocess.PIPE)
|
| + p = ''
|
| + if platform.system() == 'Windows':
|
| + # On Windows, shell must be true to get the correct environment variables.
|
| + p = subprocess.Popen(cmd_list, stdout = out, stderr = subprocess.PIPE,
|
| + shell=True)
|
| + else:
|
| + p = subprocess.Popen(cmd_list, stdout = out, stderr = subprocess.PIPE)
|
| output, not_used = p.communicate();
|
| if output:
|
| print output
|
| @@ -149,6 +151,15 @@
|
| else:
|
| return V8_AND_FROG
|
|
|
| +def GetBenchmarks():
|
| + if not PERFBOT_MODE:
|
| + return ['Smoketest']
|
| + else:
|
| + return ['Mandelbrot', 'DeltaBlue', 'Richards', 'NBody', 'BinaryTrees',
|
| + 'Fannkuch', 'Meteor', 'BubbleSort', 'Fibonacci', 'Loop', 'Permute',
|
| + 'Queens', 'QuickSort', 'Recurse', 'Sieve', 'Sum', 'Tak', 'Takl', 'Towers',
|
| + 'TreeSort']
|
| +
|
| def UploadToAppEngine():
|
| """Upload our results to our appengine server."""
|
| # TODO(efortuna): This is the most basic way to get the data up
|
| @@ -296,7 +307,7 @@
|
| """Calculate the aggregate geometric mean for V8 and frog benchmark sets,
|
| given two benchmark dictionaries."""
|
| geo_mean = 0
|
| - for benchmark in BENCHMARKS:
|
| + for benchmark in GetBenchmarks():
|
| geo_mean += math.log(self.values_dict[platform][frog_or_v8][benchmark][
|
| len(self.values_dict[platform][frog_or_v8][benchmark]) - 1])
|
|
|
| @@ -304,7 +315,7 @@
|
| if frog_or_v8 == FROG:
|
| mean = FROG_MEAN
|
| self.values_dict[platform][frog_or_v8][mean] += \
|
| - [math.pow(math.e, geo_mean / len(BENCHMARKS))]
|
| + [math.pow(math.e, geo_mean / len(GetBenchmarks()))]
|
| self.revision_dict[platform][frog_or_v8][mean] += [svn_revision]
|
|
|
| def Run(self):
|
| @@ -333,14 +344,14 @@
|
| """Super class for all performance testing."""
|
| def __init__(self, result_folder_name, platform_list, platform_type):
|
| super(PerformanceTestRunner, self).__init__(result_folder_name,
|
| - platform_list, GetVersions(), BENCHMARKS)
|
| + platform_list, GetVersions(), GetBenchmarks())
|
| self.platform_list = platform_list
|
| self.platform_type = platform_type
|
|
|
| def PlotAllPerf(self, png_filename):
|
| """Create a plot that shows the performance changes of individual benchmarks
|
| run by V8 and generated by frog, over svn history."""
|
| - for benchmark in BENCHMARKS:
|
| + for benchmark in GetBenchmarks():
|
| self.StyleAndSavePerfPlot(
|
| 'Performance of %s over time on the %s' % (benchmark,
|
| self.platform_type), 'Speed (bigger = better)', 16, 14, 'lower left',
|
| @@ -391,7 +402,7 @@
|
| tabulate_data = True
|
| elif tabulate_data:
|
| tokens = line.split()
|
| - if len(tokens) < 4 or tokens[0] not in BENCHMARKS:
|
| + if len(tokens) < 4 or tokens[0] not in GetBenchmarks():
|
| #Done tabulating data.
|
| break
|
| v8_value = float(tokens[1])
|
| @@ -433,7 +444,13 @@
|
| # ensure we haven't broken the Firefox DOM.
|
|
|
| os.chdir('frog')
|
| - RunCmd(['python', os.path.join('benchmarks', 'make_web_benchmarks.py')])
|
| + if PERFBOT_MODE:
|
| + RunCmd(['python', os.path.join('benchmarks', 'make_web_benchmarks.py')])
|
| + else:
|
| + RunCmd(['./minfrog', '--out=../tools/testing/perf_testing/smoketest/' + \
|
| + 'smoketest_frog.js', '--libdir=%s/lib' % os.getcwd(),
|
| + '--compile-only', '../tools/testing/perf_testing/smoketest/' + \
|
| + 'dartWebBase.dart'])
|
| os.chdir('..')
|
|
|
| for browser in GetBrowsers():
|
| @@ -442,13 +459,13 @@
|
| self.result_folder_name,
|
| 'perf-%s-%s-%s' % (self.cur_time, browser, version))
|
| self.AddSvnRevisionToTrace(self.trace_file)
|
| - bench_page = 'benchmark_page'
|
| + file_path = os.path.join(os.getcwd(), 'internal', 'browserBenchmarks',
|
| + 'benchmark_page_%s.html' % version)
|
| if not PERFBOT_MODE:
|
| - bench_page = 'smoketest'
|
| - pass
|
| + file_path = os.path.join(os.getcwd(), 'tools', 'testing',
|
| + 'perf_testing', 'smoketest', 'smoketest_%s.html' % version)
|
| RunCmd(['python', os.path.join('tools', 'testing', 'run_selenium.py'),
|
| - '--out', os.path.join(os.getcwd(), 'internal', 'browserBenchmarks',
|
| - '%s_%s.html' % (bench_page, version)), '--browser', browser,
|
| + '--out', file_path, '--browser', browser,
|
| '--timeout', '600', '--perf'], self.trace_file, append=True)
|
|
|
| def ProcessFile(self, afile):
|
|
|