Bug 1548355 - Tweak sLastCCEndTime handling to be able to check two tasks within < 1ms, r=mccr8
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Wed, 01 May 2019 23:23:24 +0300
changeset 531099 2aa89383ecb54ec33d95f877ac7cfde429dfab7e
parent 531098 a356546201973e425e25ba42f3ab73091b8cbc6d
child 531100 89d5d74f031b79607e7e68c2a273ffb91d2539bd
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)
reviewersmccr8
bugs1548355
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 1548355 - Tweak sLastCCEndTime handling to be able to check two tasks within < 1ms, r=mccr8
dom/base/nsJSEnvironment.cpp
--- a/dom/base/nsJSEnvironment.cpp
+++ b/dom/base/nsJSEnvironment.cpp
@@ -2054,19 +2054,21 @@ void nsJSContext::PokeShrinkingGC() {
 }
 
 // static
 void nsJSContext::MaybePokeCC() {
   if (sCCRunner || sICCRunner || !sHasRunGC || sShuttingDown) {
     return;
   }
 
-  uint32_t sinceLastCCEnd = TimeUntilNow(sLastCCEndTime);
-  if (sinceLastCCEnd && sinceLastCCEnd < NS_CC_DELAY) {
-    return;
+  if (!sLastCCEndTime.IsNull()) {
+    uint32_t sinceLastCCEnd = TimeUntilNow(sLastCCEndTime);
+    if (sinceLastCCEnd < NS_CC_DELAY) {
+      return;
+    }
   }
 
   // If GC hasn't run recently and forget skippable only cycle was run,
   // don't start a new cycle too soon.
   if ((sCleanupsSinceLastGC > NS_MAJOR_FORGET_SKIPPABLE_CALLS) &&
       !sLastForgetSkippableCycleEndTime.IsNull()) {
     uint32_t sinceLastForgetSkippableCycle =
         TimeUntilNow(sLastForgetSkippableCycleEndTime);