Changeset 183685 in webkit
- Timestamp:
- May 1, 2015 12:42:35 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/PerformanceTests/Speedometer/resources/main.js
r169540 r183685 53 53 if (displayUnit == 'ms') 54 54 return time; 55 return 60 * 1000 * suitesCount / time;55 return computerScore(time); 56 56 } 57 57 … … 159 159 } 160 160 161 function computeScore(time) { 162 return 60 * 1000 * benchmarkClient.suitesCount / time; 163 } 164 161 165 function showSection(sectionIdentifier, pushState) { 162 166 var currentSectionElement = document.querySelector('section.selected'); -
trunk/Tools/ChangeLog
r183682 r183685 1 2015-05-01 Dewei Zhu <dewei_zhu@apple.com> 2 3 Update speedometer patch to provide better UI, fix merge result bug and add "Score" metric to speedometer benchmark. 4 https://bugs.webkit.org/show_bug.cgi?id=144487 5 6 Reviewed by Ryosuke Niwa. 7 8 * Scripts/webkitpy/benchmark_runner/benchmark_runner.py: 9 (BenchmarkRunner.merge): Fix bug. 10 * Scripts/webkitpy/benchmark_runner/data/patches/Speedometer.patch: Update appearance and add "Score" metric. 11 1 12 2015-05-01 Brady Eidson <beidson@apple.com> 2 13 -
trunk/Tools/Scripts/webkitpy/benchmark_runner/benchmark_runner.py
r183621 r183685 97 97 argType = type(a) 98 98 # special handle for list type, and should be handle before equal check 99 if argType == types.ListType: 100 return a + b 101 if a == b: 99 if argType == types.ListType and len(a) and (type(a[0]) == types.StringType or type(a[0]) == types.UnicodeType): 102 100 return a 103 101 if argType == types.DictType: -
trunk/Tools/Scripts/webkitpy/benchmark_runner/data/patches/Speedometer.patch
r183309 r183685 12 12 <body> 13 13 diff --git a/Speedometer/resources/benchmark-report.js b/Speedometer/resources/benchmark-report.js 14 index c4b4c64.. c4453cd10064414 index c4b4c64..874f597 100644 15 15 --- a/Speedometer/resources/benchmark-report.js 16 16 +++ b/Speedometer/resources/benchmark-report.js 17 @@ -1, 16 +1,9@@17 @@ -1,30 +1,26 @@ 18 18 // This file can be customized to report results as needed. 19 19 … … 29 29 - document.head.appendChild(scriptElement); 30 30 - 31 var styleElement = document.createElement('style'); 32 styleElement.textContent = 'pre { padding-top: 600px; }'; 33 document.head.appendChild(styleElement); 34 @@ -36,10 +29,8 @@ 31 - var styleElement = document.createElement('style'); 32 - styleElement.textContent = 'pre { padding-top: 600px; }'; 33 - document.head.appendChild(styleElement); 34 - 35 + showSection('running') 36 var createTest; 37 var valuesByIteration = new Array; 38 + var timeValues = new Array; 39 40 window.onload = function () { 41 - document.body.removeChild(document.querySelector('main')); 42 startBenchmark(); 43 } 44 45 window.benchmarkClient = { 46 iterationCount: 5, // Use 4 different instances of DRT/WTR to run 5 iterations. 47 + willAddTestFrame: function (frame) { 48 + var main = document.querySelector('main'); 49 + var style = getComputedStyle(main); 50 + frame.style.left = main.offsetLeft + parseInt(style.borderLeftWidth) + parseInt(style.paddingLeft) + 'px'; 51 + frame.style.top = main.offsetTop + parseInt(style.borderTopWidth) + parseInt(style.paddingTop) + 'px'; 52 + }, 53 willStartFirstIteration: function (iterationCount) { 54 createTest = function (name, aggregator, isLastTest) { 55 return { 56 @@ -36,15 +32,12 @@ 35 57 name: name, 36 58 aggregator: aggregator}; … … 41 63 - PerfTestRunner.measureValueAsync(measuredValues.total); 42 64 valuesByIteration.push(measuredValues.tests); 65 + timeValues.push(measuredValues.total); 43 66 }, 44 67 didFinishLastIteration: function () { 45 @@ -52,19 +43,30 @@ 68 - document.head.removeChild(document.querySelector('style')); 69 - 70 var measuredValuesByFullName = {}; 71 function addToMeasuredValue(value, fullName, aggregator) { 72 var values = measuredValuesByFullName[fullName] || new Array; 73 @@ -52,19 +45,30 @@ 46 74 values.push(value); 47 75 values.aggregator = aggregator; … … 49 77 - 50 78 + var dict = {} 79 + var scores= timeValues.map(computeScore); 51 80 + function addToDictionaryValue(value, suiteName, testName, subtestName) { 52 + dict["Speedometer"] = dict["Speedometer"] || { "metrics" : { "Time" : [ "Total", ] }, "tests" : {}};81 + dict["Speedometer"] = dict["Speedometer"] || { "metrics" : { "Time" : [ "Total", ], "Score": { "current" : [scores] } }, "tests" : {}}; 53 82 + dict["Speedometer"]["tests"][suiteName] = dict["Speedometer"]["tests"][suiteName] || {"metrics" : { "Time" : [ "Total", ] }, "tests" : {}}; 54 83 + dict["Speedometer"]["tests"][suiteName]["tests"][testName] = dict["Speedometer"]["tests"][suiteName]["tests"][testName] || { "metrics" : { "Time" : [ "Total", ] }, "tests" : {}}; … … 56 85 + dict["Speedometer"]["tests"][suiteName]["tests"][testName]["tests"][subtestName]["metrics"]["Time"]["current"][0].push(value); 57 86 + } 58 +59 87 valuesByIteration.forEach(function (measuredValues) { 60 88 for (var suiteName in measuredValues) { … … 76 104 var fullNames = new Array; 77 105 for (var fullName in measuredValuesByFullName) 78 @@ -72,8 +7 4,22 @@106 @@ -72,8 +76,22 @@ 79 107 80 108 for (var i = 0; i < fullNames.length; i++) { … … 84 112 + var xhr = new XMLHttpRequest(); 85 113 + xhr.open("POST", "/report"); 86 + 114 + 87 115 + xhr.setRequestHeader("Content-type", "application/json"); 88 116 + xhr.setRequestHeader("Content-length", results.length); 89 117 + xhr.setRequestHeader("Connection", "close"); 90 + 118 + 91 119 + xhr.onreadystatechange = function() { 92 120 + if(xhr.readyState == XMLHttpRequest.DONE && xhr.status == 200) {
Note: See TracChangeset
for help on using the changeset viewer.