Closed Bug 1391602 Opened 7 years ago Closed 7 years ago

Budget throttling needs a notion of minimum budget amount

Categories

(Core :: DOM: Core & HTML, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: farre, Assigned: farre)

References

Details

Attachments

(1 file)

It's not enough to limit the lowest amount that we can schedule the timeout executor, since if we re-schedule we'll never decrease from that clamp (not until the budget has regenerated at least, which isn't what we want)
Assignee: nobody → afarre
Blocks: 1377766
Comment on attachment 8898753 [details] [diff] [review]
0001-Bug-1391602-Clamp-execution-budget-to-a-minimum-valu.patch

Review of attachment 8898753 [details] [diff] [review]:
-----------------------------------------------------------------

So to make sure I understand...  The problem we had before this patch is we would limit the amount of delay, but the budget could end getting further and further behind.  Even if the page paused for a while it would have a very hard time getting out of the built-up negative budget deficit.

With this patch we avoid that by limiting how negative the budget can go.  This imposes the max delay like we used to have, but prevents the site from getting into a hole it can never recover from.

Is that accurate?

::: dom/base/TimeoutManager.cpp
@@ +97,5 @@
> +TimeDuration
> +GetMinBudget(bool aIsBackground)
> +{
> +  // The minimum budget is computed by looking up the maximum allowed
> +  // delay and computing how long time it would take to regenerate

nit: s/how long time it/how long it/
Attachment #8898753 - Flags: review?(bkelly) → review+
Yes, but worse. If the executor got rescheduled it would be rescheduled to the same max value of the execution budget demanded a delay larger than that max value.
Pushed by afarre@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/82c496b0a128
Clamp execution budget to a minimum value. r=bkelly
https://hg.mozilla.org/mozilla-central/rev/82c496b0a128
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: