Changeset 217119 in webkit
- Timestamp:
- May 19, 2017, 3:09:13 AM (8 years ago)
- Location:
- trunk/PerformanceTests
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/PerformanceTests/ChangeLog
r217118 r217119 1 2017-05-19 Ryosuke Niwa <rniwa@webkit.org> 2 3 Speedometer 2.0: Elem test isn't updating DOM during the measurement 4 https://bugs.webkit.org/show_bug.cgi?id=172343 5 6 Reviewed by Antti Koivisto. 7 8 Elem test wasn't doing much work because it simply enqueues items into the work queue, which doesn't get 9 executed until the next requestAnimationFrame or setTimeout callback happens. 10 11 Expose elm's work function as contentWindow.elemWork and make the first use of rAF a synchronous callback 12 just as it would when requestAnimationFrame isn't defined, and make the second use of rAF queue up to 13 an array of callbacks, and have the test runner manually invoke each callback. 14 15 This increases the runtime of the Elm suite from 100ms to 300ms on Safari. 16 17 * Speedometer/resources/tests.js: 18 (processElmWorkQueue): Added. A helper which processes Elm's work queue and manually invokes render callbacks. 19 * Speedometer/resources/todomvc/functional-prog-examples/elm/dist/elm.js: 20 1 21 2017-05-18 Ryosuke Niwa <rniwa@webkit.org> 2 22 -
trunk/PerformanceTests/Speedometer/resources/tests.js
r217118 r217119 414 414 }); 415 415 416 function processElmWorkQueue(contentWindow) 417 { 418 contentWindow.elmWork(); 419 var callbacks = contentWindow.rAFCallbackList; 420 var i = 0; 421 while (i < callbacks.length) { 422 callbacks[i](); 423 i++; 424 } 425 contentWindow.rAFCallbackList = []; 426 } 427 416 428 Suites.push({ 417 429 name: 'Elm-TodoMVC', … … 431 443 cancelable: true 432 444 })); 433 triggerEnter(newTodo, 'keydown'); 434 } 435 }), 436 new BenchmarkTestStep('CompletingAllItems', function (params, contentWindow, contentDocument) { 437 var checkboxes = contentDocument.querySelectorAll('.toggle'); 438 for (var i = 0; i < checkboxes.length; i++) 439 checkboxes[i].click(); 440 }), 441 new BenchmarkTestStep('DeletingItems', function (params, contentWindow, contentDocument) { 442 var deleteButtons = contentDocument.querySelectorAll('.destroy'); 443 for (var i = 0; i < deleteButtons.length; i++) 444 deleteButtons[i].click(); 445 processElmWorkQueue(contentWindow); 446 triggerEnter(newTodo, 'keydown'); 447 processElmWorkQueue(contentWindow); 448 } 449 }), 450 new BenchmarkTestStep('CompletingAllItems', function (params, contentWindow, contentDocument) { 451 var checkboxes = contentDocument.querySelectorAll('.toggle'); 452 for (var i = 0; i < checkboxes.length; i++) { 453 checkboxes[i].click(); 454 processElmWorkQueue(contentWindow); 455 } 456 }), 457 new BenchmarkTestStep('DeletingItems', function (params, contentWindow, contentDocument) { 458 for (var i = 0; i < numberOfItemsToAdd; i++) { 459 contentDocument.querySelector('.destroy').click(); 460 processElmWorkQueue(contentWindow); 461 } 445 462 }), 446 463 ] -
trunk/PerformanceTests/Speedometer/resources/todomvc/functional-prog-examples/elm/dist/elm.js
r216717 r217119 2679 2679 setTimeout(work, 0); 2680 2680 } 2681 2681 window.elmWork = work; 2682 2682 2683 2683 return { … … 7010 7010 } 7011 7011 7012 var rAF = typeof requestAnimationFrame !== 'undefined' 7013 ? requestAnimationFrame 7014 : function(callback) { callback(); }; 7012 var rAF = function(callback) { callback(); }; 7015 7013 7016 7014 function withNode(id, doStuff) … … 7486 7484 7487 7485 7488 var rAF = 7489 typeof requestAnimationFrame !== 'undefined' 7490 ? requestAnimationFrame7491 : function(cb) { setTimeout(cb, 1000 / 60); }; 7486 window.rAFCallbackList = []; 7487 var rAF = function (callback) { 7488 window.rAFCallbackList.push(callback); 7489 } 7492 7490 7493 7491
Note:
See TracChangeset
for help on using the changeset viewer.