Closed
Bug 1376614
Opened 8 years ago
Closed 8 years ago
Pass budget to forgetSkippable and return early when budget has been used
Categories
(Core :: XPCOM, enhancement)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla56
| Tracking | Status | |
|---|---|---|
| firefox56 | --- | fixed |
People
(Reporter: smaug, Assigned: smaug)
References
(Blocks 1 open bug)
Details
Attachments
(2 files, 1 obsolete file)
|
13.41 KB,
patch
|
mccr8
:
review+
|
Details | Diff | Splinter Review |
|
13.55 KB,
patch
|
Details | Diff | Splinter Review |
In some cases forgetSkippables are too slow. I think we could make it more incremental.
| Assignee | ||
Updated•8 years ago
|
Assignee: nobody → bugs
| Assignee | ||
Comment 1•8 years ago
|
||
This seems to trigger the overbudget every now and then when running speedometer
remote: Follow the progress of your build on Treeherder:
remote: https://treeherder.mozilla.org/#/jobs?repo=try&revision=8a8ed0c53a14c8c530d4b66eeaebd12237ab8673
| Assignee | ||
Comment 2•8 years ago
|
||
I think I want always some budget.
remote: View your change here:
remote: https://hg.mozilla.org/try/rev/4647333853181099895b35d7b99f79cda3ae0a97
remote:
remote: Follow the progress of your build on Treeherder:
remote: https://treeherder.mozilla.org/#/jobs?repo=try&revision=4647333853181099895b35d7b99f79cda3ae0a97
Attachment #8881756 -
Attachment is obsolete: true
| Assignee | ||
Updated•8 years ago
|
Attachment #8881776 -
Flags: review?(continuation)
Comment 3•8 years ago
|
||
Comment on attachment 8881776 [details] [diff] [review]
v2
Review of attachment 8881776 [details] [diff] [review]:
-----------------------------------------------------------------
r=me with these fixes
::: xpcom/base/nsCycleCollector.cpp
@@ +1073,5 @@
> auto iterFromLastEntry = mEntries.IterFromLast();
> for (; !iter.Done(); iter.Next()) {
> nsPurpleBufferEntry& e = iter.Get();
> if (e.mObject) {
> + if (!aVisitor.Visit(*this, &e)) {
It is a little ugly to require these checks here, but the alternative would be to always check a budget in here, and then pass in unlimitedBudget for the other cases, which isn't great either. So I guess this is okay.
@@ +2780,5 @@
> + if (mBudget.isOverBudget()) {
> + return false;
> + }
> +
> + mBudget.step();
Should this be stepped by a larger value? With 1, we only actually check the time every 1000 things in the purple buffer.
@@ +2804,4 @@
> }
>
> private:
> + js::SliceBudget mBudget;
This should be a reference. There's state in the SliceBudget that gets modified when we check the budget.
Attachment #8881776 -
Flags: review?(continuation) → review+
| Assignee | ||
Comment 4•8 years ago
|
||
We could pass budget as value or reference, doesn't really matter in the current setup.
| Assignee | ||
Comment 5•8 years ago
|
||
(In reply to Andrew McCreight [:mccr8] from comment #3)
> ::: xpcom/base/nsCycleCollector.cpp
> @@ +1073,5 @@
> > auto iterFromLastEntry = mEntries.IterFromLast();
> > for (; !iter.Done(); iter.Next()) {
> > nsPurpleBufferEntry& e = iter.Get();
> > if (e.mObject) {
> > + if (!aVisitor.Visit(*this, &e)) {
>
> It is a little ugly to require these checks here, but the alternative would
> be to always check a budget in here, and then pass in unlimitedBudget for
> the other cases, which isn't great either. So I guess this is okay.
Yeah. I just took the simplest approach
> @@ +2780,5 @@
> > + if (mBudget.isOverBudget()) {
> > + return false;
> > + }
> > +
> > + mBudget.step();
>
> Should this be stepped by a larger value? With 1, we only actually check the
> time every 1000 things in the purple buffer.
Well that is what MarkRoots does. Though that is too high. Perhaps I could try 5.
| Assignee | ||
Comment 6•8 years ago
|
||
I can check how many other entries were removed from purple buffer (because of CanSkip) and pass also that number to step
| Assignee | ||
Comment 7•8 years ago
|
||
Er, no I can't. I don't have that information.
I guess I'll just use random number 5
| Assignee | ||
Comment 8•8 years ago
|
||
Pushed by opettay@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/648731530278
Pass budget to forgetSkippable and return early when budget has been used, r=mccr8
Comment 10•8 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox56:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in
before you can comment on or make changes to this bug.
Description
•