Bug 1547069 - [raptor] Reduce CPU overhead when waiting for results. r=perftest-reviewers,rwood
authorHenrik Skupin <mail@hskupin.info>
Tue, 30 Apr 2019 07:58:56 +0000
changeset 530714 6d5bec8df2bcf4694a3f4c99b7d048dd776e300b
parent 530713 799e477bd09d283ad02397cb1daf154ed9379a92
child 530715 3e2c790195768de837c9487d5d8aef5975bf5fd2
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersperftest-reviewers, rwood
bugs1547069
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1547069 - [raptor] Reduce CPU overhead when waiting for results. r=perftest-reviewers,rwood The method checkForResult is called each and every 5 milliseconds while the Raptor tests are running. This actually consumes a lot of CPU which can decrease the performance of the website under test. It's totally enough to check for results 4 times in a minute. Differential Revision: https://phabricator.services.mozilla.com/D29176
testing/raptor/webext/raptor/runner.js
--- a/testing/raptor/webext/raptor/runner.js
+++ b/testing/raptor/webext/raptor/runner.js
@@ -238,30 +238,30 @@ async function waitForResult() {
   let results = await new Promise(resolve => {
     function checkForResult() {
       console.log("checking results...");
       switch (testType) {
         case TEST_BENCHMARK:
           if (!isBenchmarkPending) {
             resolve();
           } else {
-            setTimeout(checkForResult, 5);
+            setTimeout(checkForResult, 250);
           }
           break;
 
         case TEST_PAGE_LOAD:
           if (!isHeroPending &&
               !isFNBPaintPending &&
               !isFCPPending &&
               !isDCFPending &&
               !isTTFIPending &&
               !isLoadTimePending) {
             resolve();
           } else {
-            setTimeout(checkForResult, 5);
+            setTimeout(checkForResult, 250);
           }
           break;
       }
     }
 
     checkForResult();
   });