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

Side by Side Diff: LayoutTests/resources/magnitude-perf.js

Issue 211933008: Remove multiple GC calls and replace GCController.collect calls with GCController.collectAll (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: revert change to worker-event-listener Created 6 years, 9 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 | « LayoutTests/resources/gc.js ('k') | LayoutTests/storage/indexeddb/cursor-cast.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Magnitude verifies time complexity of a function. 1 // Magnitude verifies time complexity of a function.
2 // Magnitude.run can be called multiple times in a single script if desired, 2 // Magnitude.run can be called multiple times in a single script if desired,
3 // optionally with different parameters each time. 3 // optionally with different parameters each time.
4 // 4 //
5 // Usage: 5 // Usage:
6 // <script src="../resources/magnitude-perf.js"></script> 6 // <script src="../resources/magnitude-perf.js"></script>
7 // <script> 7 // <script>
8 // function setup(magnitude) 8 // function setup(magnitude)
9 // { 9 // {
10 // ... 10 // ...
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 192
193 Magnitude._runTime = function(setup, test, magnitude) 193 Magnitude._runTime = function(setup, test, magnitude)
194 { 194 {
195 setup(magnitude); 195 setup(magnitude);
196 196
197 var debugStr = 'run for magnitude ' + magnitude; 197 var debugStr = 'run for magnitude ' + magnitude;
198 if (window.GCController) { 198 if (window.GCController) {
199 if (GCController.getJSObjectCount) 199 if (GCController.getJSObjectCount)
200 debugStr += ' jsObjectCountBefore ' + GCController.getJSObjectCount( ); 200 debugStr += ' jsObjectCountBefore ' + GCController.getJSObjectCount( );
201 201
202 // Do a gc to reduce likelihood of gc during the test run. 202 GCController.collectAll();
203 // Do multiple gc's for V8 to clear DOM wrappers.
204 GCController.collect();
205 GCController.collect();
206 GCController.collect();
207 203
208 if (GCController.getJSObjectCount) 204 if (GCController.getJSObjectCount)
209 debugStr += ' jsObjectCountAfter ' + GCController.getJSObjectCount() ; 205 debugStr += ' jsObjectCountAfter ' + GCController.getJSObjectCount() ;
210 } 206 }
211 207
212 Magnitude._debug(debugStr); 208 Magnitude._debug(debugStr);
213 209
214 var nowFunction = window.performance && window.performance.now ? 210 var nowFunction = window.performance && window.performance.now ?
215 window.performance.now.bind(window.performance) : Date.now; 211 window.performance.now.bind(window.performance) : Date.now;
216 212
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 }; 347 };
352 348
353 // Register listener 349 // Register listener
354 window.addEventListener('load', function() { 350 window.addEventListener('load', function() {
355 // FIXME: Add Magnitude.waitUntilDone/notifyDone for tests that need to 351 // FIXME: Add Magnitude.waitUntilDone/notifyDone for tests that need to
356 // operate after the load event has fired. 352 // operate after the load event has fired.
357 if (window.testRunner) 353 if (window.testRunner)
358 document.body.innerHTML = ''; 354 document.body.innerHTML = '';
359 document.body.appendChild(Magnitude._container); 355 document.body.appendChild(Magnitude._container);
360 }, false); 356 }, false);
OLDNEW
« no previous file with comments | « LayoutTests/resources/gc.js ('k') | LayoutTests/storage/indexeddb/cursor-cast.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698