Page MenuHomePhabricator

Bug 1899749 - Use profiler markers for getting performance data r=#dom-worker-reviewers!
ClosedPublic

Authored by jmarshall on May 23 2024, 12:49 PM.
Referenced Files
F67859149: D211368.1776518532.diff
Fri, Apr 17, 1:22 PM
Unknown Object (File)
Mon, Apr 6, 5:01 PM
Unknown Object (File)
Mon, Apr 6, 2:15 PM
Unknown Object (File)
Mon, Apr 6, 5:46 AM
Unknown Object (File)
Sun, Apr 5, 9:30 PM
Unknown Object (File)
Sun, Apr 5, 9:05 PM
Unknown Object (File)
Sun, Apr 5, 6:22 PM
Unknown Object (File)
Sun, Apr 5, 3:21 PM

Details

Summary

Use profiler markers to collect timing data. Markers of known name:

AUTO_PROFILER_MARKER_TEXT("interesting thing #1", DOM, {}, ""_ns);
AUTO_PROFILER_MARKER_TEXT("interesting thing #2", DOM, {}, ""_ns);

can be inspected from the perftest:

await startProfiler();
interestingThings();
let pdata = await stopProfiler();
let duration_ms = inspectProfile(pdata, [
    "interesting thing #1",
    "interesting thing #2"
]);

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
jmarshall updated this revision to Diff 871203.
smaug requested changes to this revision.Jun 4 2024, 8:47 AM
smaug added a subscriber: smaug.
smaug added inline comments.
dom/serviceworkers/ServiceWorkerActors.cpp
35

"swreg perftest" is quite unusual text for a profiler marker. Do we need that at all? It doesn't seem to add any information to the marker. Marker name (like "InitServiceWorkerRegistrationParent") is enough, and EmptyCString() could be passed as the last param.
"swreg perftest" would be shown in all the profiler profiles, not only in the service worker performance tests, and I don't think we want that.

This revision now requires changes to proceed.Jun 4 2024, 8:47 AM
dom/serviceworkers/ServiceWorkerActors.cpp
35

This is used to identify the markers associated with the test--see line 71 of test_registration.html:

duration_ms = inspectProfile(pdata, "swreg perftest");

I think the name and additional text are the only settable parts of markers we can use to identify them.

jmarshall updated this revision to Diff 871469.
jmarshall retitled this revision from Bug 1899749 - Use profiler markers for getting performance data r=#dom-worker-reviewers! to Bug 1889121 - Use profiler markers for getting performance data r=#dom-worker-reviewers!.
jmarshall changed the Bugzilla Bug ID from 1899749 to 1889121.
aabh requested changes to this revision.Jun 4 2024, 5:09 PM
aabh added a subscriber: aabh.
aabh added inline comments.
dom/serviceworkers/ServiceWorkerActors.cpp
35

I would agree with @smaug - the swreg perftest data will show up in collected profiles which might be confusing.

From a quick search, it looks like the names of the markers introduced in this patch should be enough to uniquely identify them for the tests, no extra text needed. (Please correct me if I'm wrong).

dom/serviceworkers/test/performance/perfutils.js
111

Nit: I presume "Col" is short for "Column". This confused me at first, as we tend to think of these as indices, so a name like nameIdx or nameIx might be more descriptive.

This revision now requires changes to proceed.Jun 4 2024, 5:09 PM
jmarshall updated this revision to Diff 872220.

So does this still have "swreg perftest" on purpose?
Looks like https://phabricator.services.mozilla.com/D212565 doesn't use that.

Now removed.

smaug added a reviewer: asuth.

rs+, but I think asuth should say whether these markers are the most important ones.
And whether the duration of the markers is what we need to measure, or time between the markers.

dom/serviceworkers/test/performance/perfutils.js
3

en-IN ?

81

Hmm, how large is the profileData? Is it possible that it is in some cases too large for setAsyncMessage?

dom/serviceworkers/test/performance/perfutils.js
81

If we fail to serialize, the test will fail and not generate perf data, so at least we won't pollute results.

asuth added a project: testing-approved.

Very cool!

Testing: Performance tests are specifically updated.

This revision is now accepted and ready to land.Jun 10 2024, 7:31 PM
This revision is now accepted and ready to land.Jun 11 2024, 11:05 AM
jmarshall retitled this revision from Bug 1889121 - Use profiler markers for getting performance data r=#dom-worker-reviewers! to Bug 1903766 - Use profiler markers for getting performance data r=#dom-worker-reviewers!.
jmarshall edited the summary of this revision. (Show Details)
jmarshall changed the Bugzilla Bug ID from 1889121 to 1903766.
canaltinova added inline comments.
dom/serviceworkers/test/performance/perfutils.js
57

Do we really need all the threads? If we know which threads add these markers for sure, it would be better to limit to only those threads to reduce the profiler overhead.

jmarshall retitled this revision from Bug 1903766 - Use profiler markers for getting performance data r=#dom-worker-reviewers! to Bug 1899749 - Use profiler markers for getting performance data r=#dom-worker-reviewers!.Jul 19 2024, 12:32 PM
jmarshall changed the Bugzilla Bug ID from 1903766 to 1899749.
jmarshall edited the summary of this revision. (Show Details)
jmarshall edited the summary of this revision. (Show Details)
jmarshall edited the summary of this revision. (Show Details)
jmarshall edited the summary of this revision. (Show Details)
This revision now requires review to proceed.Jul 25 2024, 12:56 PM

You've pushed a patch that is making changes in areas of Performance Testing.

Please ensure that all the documentation related to this change is updated. Additionally, please ensure that documentation is added for any new features, workarounds, or enhancements.

You can find the existing documentation for Performance Testing here: https://firefox-source-docs.mozilla.org/testing/perfdocs/

NOTE: A documentation file was modified in diff 894709

It can be previewed for one week:


If you see a problem in this automated review, please report it here.

NOTE: 2 documentation files were modified in diff 894792

They can be previewed for one week:


If you see a problem in this automated review, please report it here.

This revision is now accepted and ready to land.Jul 25 2024, 8:08 PM