Closed Bug 2009858 Opened 7 months ago Closed 7 months ago

There is still noticiable rooting cost in doxbee-promise

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

RESOLVED FIXED
149 Branch
Tracking Status
firefox149 --- fixed

People

(Reporter: mgaudet, Assigned: mgaudet)

References

(Blocks 2 open bugs)

Details

Attachments

(13 files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

Visible in this recent profile: https://share.firefox.dev/3Nj3nDx

We can get rid of some of this by using RootedTuple/RootedField.

Severity: -- → N/A
Priority: -- → P3
Summary: EnqueuePromiseREactionJob still has noticiable rooting cost in doxbee-promise → EnqueuePromiseReactionJob still has noticiable rooting cost in doxbee-promise

Reworking that profile you can spot a bunch more opportunities, so I'm resummarying this bug and taking it.

I've got a stack that I locally measure at a 1.5-2% improvement just from adjusting rooting.

Assignee: nobody → mgaudet
Keywords: good-next-bug
Summary: EnqueuePromiseReactionJob still has noticiable rooting cost in doxbee-promise → There is still noticiable rooting cost in doxbee-promise

Used in the next patch in the stack to handle a conversion from

RootedField<PromiseObject*> to Handle<JSObject*>

Attachment #9538635 - Attachment description: Bug 2009858 - Eliminate excess rooting overhead in EnqueueProomiseResolveThenableJob r?arai → Bug 2009858 - Eliminate excess rooting overhead in EnqueuePromiseResolveThenableJob r?arai

Otherwise translation to RootedField can be a refactoring hazard. Consider

RootedTuple<JSObject*> roots(cx); 
for (x : container) {
	RootedField<JSObject*, 0> field(roots); 
	if (x.condition) {
		field = x.obj;
	}

	if (field && x.condition_two) {
		do_thing(field);
	}
}

In this loop, without re-initializing field, we can leak obj from a previous
iteration to a new one.

Pushed by mgaudet@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/34d3dad9c98a https://hg.mozilla.org/integration/autoland/rev/f2b4c61c9966 Eliminate excess rooting overhead in EnqueuePromiseReactionJob r=arai https://github.com/mozilla-firefox/firefox/commit/087b3564324d https://hg.mozilla.org/integration/autoland/rev/21bd49d8d0f6 Eliminate excess rooting overhead in js::ResolvePromiseInternal r=arai https://github.com/mozilla-firefox/firefox/commit/23234dc94ddb https://hg.mozilla.org/integration/autoland/rev/6111673a2fa1 Eliminate excess rooting overhead in js::ReactToUnwrappedPromise r=arai https://github.com/mozilla-firefox/firefox/commit/2f12fa226f88 https://hg.mozilla.org/integration/autoland/rev/1a3959df8ee5 Eliminate excess rooting overhead in InternalAwait r=arai https://github.com/mozilla-firefox/firefox/commit/37ded86b0f9c https://hg.mozilla.org/integration/autoland/rev/2bd3be20e763 Support conversion to superclass handle type for RootedField r=jonco https://github.com/mozilla-firefox/firefox/commit/17d5c7ccf9b7 https://hg.mozilla.org/integration/autoland/rev/6a5705563ff8 Eliminate excess rooting overhead in js::AsyncFromSyncIteratorMethod r=arai https://github.com/mozilla-firefox/firefox/commit/35eb641ef895 https://hg.mozilla.org/integration/autoland/rev/bba9e03de600 Eliminate excess rooting overhead in PromiseReactionJob r=arai https://github.com/mozilla-firefox/firefox/commit/c852a41b8423 https://hg.mozilla.org/integration/autoland/rev/2fb554957418 Eliminate excess rooting overhead in PromiseResolveThenableJob r=arai https://github.com/mozilla-firefox/firefox/commit/926b80d36b7b https://hg.mozilla.org/integration/autoland/rev/add9353df378 Eliminate excess rooting overhead in EnqueuePromiseResolveThenableJob r=arai https://github.com/mozilla-firefox/firefox/commit/a624ab4f69e9 https://hg.mozilla.org/integration/autoland/rev/c63165bb96b3 Eliminate excess rooting overhead in js::OriginalPromiseThen r=arai https://github.com/mozilla-firefox/firefox/commit/7e18f6bacaa0 https://hg.mozilla.org/integration/autoland/rev/b56a322991f0 Always default initialize a RootedFieldValue r=jonco https://github.com/mozilla-firefox/firefox/commit/53f8c7d9b64c https://hg.mozilla.org/integration/autoland/rev/be31b687694c Eliminate excess rooting overhead in FulfillMaybeWrappedPromise r=arai https://github.com/mozilla-firefox/firefox/commit/b371451c3a65 https://hg.mozilla.org/integration/autoland/rev/2e741a895ef5 Eliminate excess rooting overhead in PromiseObject::forEachReachReactionRecord r=arai
Duplicate of this bug: 1999988
QA Whiteboard: [qa-triage-done-c150/b149]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: