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

Side by Side Diff: chrome/test/data/dromaeo/webrunner.js

Issue 2499923002: Update dromaeo to upstream a876d5250befbc41e2deab9d10cf6085b511d5ed (Closed)
Patch Set: Modified readme Created 4 years 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
« no previous file with comments | « chrome/test/data/dromaeo/tests/jslib-traverse-prototype.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 (function(){ 1 (function(){
2 2
3 // Populated from: http://www.medcalc.be/manual/t-distribution.php 3 // Populated from: http://www.medcalc.be/manual/t-distribution.php
4 // 95% confidence for N - 1 = 4 4 // 95% confidence for N - 1 = 4
5 var tDistribution = 2.776; 5 var tDistribution = 2.776;
6 6
7 // The number of individual test iterations to do 7 // The number of individual test iterations to do
8 var numTests = 5; 8 var numTests = 5;
9 9
10 // The type of run that we're doing (options are "runs/s" or "ms") 10 // The type of run that we're doing (options are "runs/s" or "ms")
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 data.scale = num; 141 data.scale = num;
142 142
143 logTest(data); 143 logTest(data);
144 144
145 dequeue(); 145 dequeue();
146 } 146 }
147 }, 1); 147 }, 1);
148 }); 148 });
149 149
150 function compute(times, runs){ 150 function compute(times, runs){
151 » » » var results = {runs: runs}, num = times.length; 151 » » » var results = {runs: runs}, num = times.length, middle = num/2;
152 152
153 times = times.sort(function(a,b){ 153 times = times.sort(function(a,b){
154 return a - b; 154 return a - b;
155 }); 155 });
156 156
157 // Make Sum 157 // Make Sum
158 results.sum = 0; 158 results.sum = 0;
159 159
160 for ( var i = 0; i < num; i++ ) 160 for ( var i = 0; i < num; i++ )
161 results.sum += times[i]; 161 results.sum += times[i];
162 162
163 // Make Min 163 // Make Min
164 results.min = times[0]; 164 results.min = times[0];
165 165
166 // Make Max 166 // Make Max
167 results.max = times[ num - 1 ]; 167 results.max = times[ num - 1 ];
168 168
169 // Make Mean 169 // Make Mean
170 results.mean = results.sum / num; 170 results.mean = results.sum / num;
171 171
172 // Make Median 172 // Make Median
173 results.median = num % 2 == 0 ? 173 results.median = num % 2 == 0 ?
174 » » » » (times[Math.floor(num/2)] + times[Math.ceil(num/ 2)]) / 2 : 174 » » » » (times[middle-1] + times[middle]) / 2 :
175 » » » » times[Math.round(num/2)]; 175 » » » » times[Math.floor(middle)];
176 176
177 // Make Variance 177 // Make Variance
178 results.variance = 0; 178 results.variance = 0;
179 179
180 for ( var i = 0; i < num; i++ ) 180 for ( var i = 0; i < num; i++ )
181 results.variance += Math.pow(times[i] - results. mean, 2); 181 results.variance += Math.pow(times[i] - results. mean, 2);
182 182
183 results.variance /= num - 1; 183 results.variance /= num - 1;
184 184
185 // Make Standard Deviation 185 // Make Standard Deviation
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
839 var means = aggregated[name]; 839 var means = aggregated[name];
840 var sum = 0; 840 var sum = 0;
841 for (var i = 0; i < means.length; i++) sum += me ans[i]; 841 for (var i = 0; i < means.length; i++) sum += me ans[i];
842 results[name] = Math.pow(Math.E, sum/means.lengt h).toString(); 842 results[name] = Math.pow(Math.E, sum/means.lengt h).toString();
843 } 843 }
844 844
845 return results; 845 return results;
846 } 846 }
847 } 847 }
848 })(); 848 })();
OLDNEW
« no previous file with comments | « chrome/test/data/dromaeo/tests/jslib-traverse-prototype.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698