Closed Bug 1499725 Opened Last year Closed Last year
Task Runner timers more efficient
Instead of creating a timer and then setting the timer's target, we can determine the timer's target and pass it in directly when the timer is created. This reordering of steps is slightly more efficient, since SetTarget() is both a virtual call and requires locking, both of which can be skipped if we know the target at timer creation time. If we're reusing the timer, we also don't need to repeatedly set the timer's target: we can set the target once at timer creation, and then be done. We can do this safely here because mTaskCategory doesn't change throughout the life of the IdleTaskRunner; we make mTaskCategory `const` to make this more explicit to the reader.
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/mozilla-inbound/rev/7b36a8c21a15 make IdleTaskRunner timers more efficient; r=farre
You need to log in before you can comment on or make changes to this bug.