| Index: tools/perf/benchmarks/sunspider.py
|
| diff --git a/tools/perf/benchmarks/sunspider.py b/tools/perf/benchmarks/sunspider.py
|
| index 166043c483966c2dc7231c983c3302ce1cf4ea58..06126a348f6bfeb5297680b325d40c73b30c9983 100644
|
| --- a/tools/perf/benchmarks/sunspider.py
|
| +++ b/tools/perf/benchmarks/sunspider.py
|
| @@ -14,6 +14,63 @@ from telemetry.value import list_of_scalar_values
|
|
|
| _URL = 'http://www.webkit.org/perf/sunspider-1.0.2/sunspider-1.0.2/driver.html'
|
|
|
| +DESCRIPTIONS = {
|
| + '3d-cube':
|
| + 'Pure JavaScript computations of the kind you might use to do 3d '
|
| + 'rendering, but without the rendering. This ends up mostly hitting '
|
| + 'floating point math and array access.',
|
| + '3d-morph':
|
| + 'Pure JavaScript computations of the kind you might use to do 3d '
|
| + 'rendering, but without the rendering. This ends up mostly hitting '
|
| + 'floating point math and array access.',
|
| + '3d-raytrace':
|
| + 'Pure JavaScript computations of the kind you might use to do 3d '
|
| + 'rendering, but without the rendering. This ends up mostly hitting '
|
| + 'floating point math and array access.',
|
| + 'access-binary-trees': 'Array, object property and variable access.',
|
| + 'access-fannkuch': 'Array, object property and variable access.',
|
| + 'access-nbody': 'Array, object property and variable access.',
|
| + 'access-nsieve': 'Array, object property and variable access.',
|
| + 'bitops-3bit-bits-in-byte':
|
| + 'Bitwise operations, these can be useful for various things '
|
| + 'including games, mathematical computations, and various kinds of '
|
| + 'encoding/decoding. It\'s also the only kind of math in JavaScript '
|
| + 'that is done as integer, not floating point.',
|
| + 'bitops-bits-in-byte':
|
| + 'Bitwise operations, these can be useful for various things '
|
| + 'including games, mathematical computations, and various kinds of '
|
| + 'encoding/decoding. It\'s also the only kind of math in JavaScript '
|
| + 'that is done as integer, not floating point.',
|
| + 'bitops-bitwise-and':
|
| + 'Bitwise operations, these can be useful for various things '
|
| + 'including games, mathematical computations, and various kinds of '
|
| + 'encoding/decoding. It\'s also the only kind of math in JavaScript '
|
| + 'that is done as integer, not floating point.',
|
| + 'bitops-nsieve-bits':
|
| + 'Bitwise operations, these can be useful for various things '
|
| + 'including games, mathematical computations, and various kinds of '
|
| + 'encoding/decoding. It\'s also the only kind of math in JavaScript '
|
| + 'that is done as integer, not floating point.',
|
| + 'controlflow-recursive':
|
| + 'Control flow constructs (looping, recursion, conditionals). Right '
|
| + 'now it mostly covers recursion, as the others are pretty well covered '
|
| + 'by other tests.',
|
| + 'crypto-aes': 'Real cryptography code related to AES.',
|
| + 'crypto-md5': 'Real cryptography code related to MD5.',
|
| + 'crypto-sha1': 'Real cryptography code related to SHA1.',
|
| + 'date-format-tofte': 'Performance of JavaScript\'s "date" objects.',
|
| + 'date-format-xparb': 'Performance of JavaScript\'s "date" objects.',
|
| + 'math-cordic': 'Various mathematical type computations.',
|
| + 'math-partial-sums': 'Various mathematical type computations.',
|
| + 'math-spectral-norm': 'Various mathematical type computations.',
|
| + 'regexp-dna': 'Regular expressions performance.',
|
| + 'string-base64': 'String processing.',
|
| + 'string-fasta': 'String processing',
|
| + 'string-tagcloud': 'String processing code to generate a giant "tagcloud".',
|
| + 'string-unpack-code': 'String processing code to extracting compressed JS.',
|
| + 'string-validate-input': 'String processing.',
|
| +}
|
| +
|
|
|
| class _SunspiderMeasurement(page_measurement.PageMeasurement):
|
| def __init__(self):
|
| @@ -39,11 +96,17 @@ class _SunspiderMeasurement(page_measurement.PageMeasurement):
|
|
|
| js_get_results = 'JSON.stringify(output);'
|
| js_results = json.loads(tab.EvaluateJavaScript(js_get_results))
|
| +
|
| + # Below, r is a map of benchmark names to lists of result numbers,
|
| + # and totals is a list of totals of result numbers.
|
| + # js_results is: formatted like this:
|
| + # [
|
| + # {'3d-cube': v1, '3d-morph': v2, ...},
|
| + # {'3d-cube': v3, '3d-morph': v4, ...},
|
| + # ...
|
| + # ]
|
| r = collections.defaultdict(list)
|
| totals = []
|
| - # js_results is: [{'foo': v1, 'bar': v2},
|
| - # {'foo': v3, 'bar': v4},
|
| - # ...]
|
| for result in js_results:
|
| total = 0
|
| for key, value in result.iteritems():
|
| @@ -52,9 +115,12 @@ class _SunspiderMeasurement(page_measurement.PageMeasurement):
|
| totals.append(total)
|
| for key, values in r.iteritems():
|
| results.AddValue(list_of_scalar_values.ListOfScalarValues(
|
| - results.current_page, key, 'ms', values, important=False))
|
| + results.current_page, key, 'ms', values, important=False,
|
| + description=DESCRIPTIONS.get(key)))
|
| results.AddValue(list_of_scalar_values.ListOfScalarValues(
|
| - results.current_page, 'Total', 'ms', totals))
|
| + results.current_page, 'Total', 'ms', totals,
|
| + description='Totals of run time for each different type of benchmark '
|
| + 'in sunspider'))
|
|
|
|
|
| class Sunspider(benchmark.Benchmark):
|
|
|