Commit Graph

538 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
39faee19b9 Bug 1911448 - Remove DOMContentFlushed. r=smaug,perftest-reviewers,sparky
As per comments in bug 1910411's patches and others, it's not a useful
metric, specially now that we have LCP and so on.

Actually there doesn't seem to be any consumer of it since bug 1892001.

Differential Revision: https://phabricator.services.mozilla.com/D218489
2024-08-05 12:20:43 +00:00
Adam Vandolder
2007a1348b Bug 1895254 - Prototype the Navigation API WebIDL. r=farre,dom-core,peterv
Differential Revision: https://phabricator.services.mozilla.com/D210088
2024-07-24 04:56:35 +00:00
Stanca Serban
228aadad49 Backed out changeset c634fecd6270 (bug 1895254) for causing build bustages in Navigation.cpp. 2024-07-24 07:27:32 +03:00
Adam Vandolder
b6218e2851 Bug 1895254 - Prototype the Navigation API WebIDL. r=farre,dom-core,peterv
Differential Revision: https://phabricator.services.mozilla.com/D210088
2024-07-24 03:44:15 +00:00
Sean Feng
0742a41fa7 Bug 1874756 - Simplify and reduce the number of hashtable lookups for LCP implementation r=emilio
Two changes are introduced:

* LCP has a hashtable called `ContentIdentifiersForLCP` to store
(element, image) pairs to avoid processing the same pair multiple
times. Instead of using weak pointers for elements, this patch changes
it to use raw pointers for better performance. Also, makes the
hashtable to use element alone as the key, so that the entry
can be quickly removed when nsINode::LastRelease is called.

* Another change to make imgRequestProxy stores the
timestamps for LCP, so we can create LCP entries when the size
is available, instead of creating one temporarily and updating it
later. This allows us to eliminate a hashtable called
`mImageLCPEntryMap` for better performance.

Differential Revision: https://phabricator.services.mozilla.com/D214315
2024-07-23 20:42:40 +00:00
Sandor Molnar
ea3243f101 Backed out changeset 455d12dff44e (bug 1895254) for causing android wpt crashes @ /html/dom/idlharness.https.html CLOSED TREE 2024-07-19 22:47:01 +03:00
Adam Vandolder
5850778c78 Bug 1895254 - Prototype the Navigation API WebIDL. r=farre,dom-core,peterv
Differential Revision: https://phabricator.services.mozilla.com/D210088
2024-07-19 15:16:40 +00:00
Cosmin Sabou
ef5a7d3fda Backed out changeset 1b14354719c0 (bug 1895254) for causing bustages on NavigationTransition. CLOSED TREE 2024-07-19 00:20:49 +03:00
Adam Vandolder
48629bb869 Bug 1895254 - Prototype the Navigation API WebIDL. r=farre,dom-core,peterv
Differential Revision: https://phabricator.services.mozilla.com/D210088
2024-07-18 18:10:40 +00:00
Stanca Serban
bb3aa3a009 Backed out changeset 04ca9845721e (bug 1895254) for causing multiple failures. CLOSED TREE 2024-07-17 23:10:14 +03:00
Adam Vandolder
8ead4811f0 Bug 1895254 - Prototype the Navigation API WebIDL. r=farre,dom-core,peterv
Differential Revision: https://phabricator.services.mozilla.com/D210088
2024-07-17 17:58:27 +00:00
Emilio Cobos Álvarez
71bf77b3fe Bug 1904442 - Rename GlobalTeardownObserver::GetOwner to GetOwnerWindow. r=smaug,media-playback-reviewers,dom-storage-reviewers,aosmond,padenot,asuth
Also HasOrHasHadOwner to HasOrHasHadOwnerWindow.

Differential Revision: https://phabricator.services.mozilla.com/D214772
2024-07-01 11:49:59 +00:00
Michael van Straten
8135451a10 Bug 1902995 - Check if profiler thread is being profiled for markers. r=canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D213928
2024-06-18 14:09:48 +00:00
Thomas Wisniewski
cd1ecb3d00 Bug 1796785 - Add response status code to Resource Timing API; r=sefeng,webidl,emilio
Differential Revision: https://phabricator.services.mozilla.com/D213835
2024-06-18 13:42:32 +00:00
Masayuki Nakano
fb5048e05b Bug 1675847 - part 1: Rename eMouseClick and eMouseAuxClick r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D212999
2024-06-14 00:18:46 +00:00
Thomas Wisniewski
35368d7f72 Bug 1800443 - Support the contentType attribute of the Resource Timing API, and have it and the encoded/decoded body size use the CORS check rather than TAO; r=sefeng,valentin,webidl,necko-reviewers,saschanaz,emilio
Differential Revision: https://phabricator.services.mozilla.com/D208965
2024-06-13 13:46:05 +00:00
Noemi Erli
4e8a6e5c2f Backed out changeset f24d04943626 (bug 1800443) for causing bustages in nsITimedChannel.h 2024-06-12 21:17:16 +03:00
Thomas Wisniewski
53aa94d1a5 Bug 1800443 - Support the contentType attribute of the Resource Timing API, and have it and the encoded/decoded body size use the CORS check rather than TAO; r=sefeng,valentin,webidl,necko-reviewers,saschanaz,emilio
Differential Revision: https://phabricator.services.mozilla.com/D208965
2024-06-12 17:03:13 +00:00
Cathie Chen
bc1d7fc121 Bug 1896150 - Add RenderBlockingStatusType to the PerformanceResourceTiming Interface, r=emilio,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D210053
2024-05-15 12:57:05 +00:00
Eden Chuang
a718e4758f Bug 1769913 - P3 Remove WorkerRunnable::mWorkerPrivate. r=dom-worker-reviewers,asuth
WorkerRunnable no longer keeps a raw pointer(mWorkerPrivate) for the associated WorkerPrivate in this patch.
Removing the WorkerRunnable::mWorkerPrivate needs to fix the following problems.

1. Thread assertions in WorkerRunnable::Dispatch()

To fix this problem, the associated WorkerPrivate is as a parameter and passed to WorkerRunnable::Dispatch() for the dispatching thread assertions. This associated WorkerPrivate is also propagated to PreDispatch() and PostDispatch() for the children classes of WorkerRunnable()

2. Get the associated WorkerPrivate in WorkerRunnable::Run() for environment setup(GlobabObject, JSContext setting for the runnable)

- For WorkerThreadRunnable

Since WorkerThreadRunnable is supposed to run on the worker thread, it does not need to keep a raw pointer to WorkerPrivate as its class member. GetCurrentThreadWorkerPrivate() should always get the correct WorkerPrivate for WorkerThreadRunnable.

- For WorkerParentThreadRunnable

WorkerParentRef is introduced to keep a RefPtr<WorkerPrivate> for WorkerParentThreadRunnable instead of using a raw pointer.
Checking the associated WorkerPrivate existence by WorkerParentRef at the beginning of WorkerParentThreadRunnable::Run(). If the Worker has already shut down, WorkerParentThreadRunnable cannot do anything with the associated WorkerPrivate, so WorkerParentThreadRunnable::Run() will return NS_OK directly but with a warning.

The associated WorkerPrivate is also passed into WorkerRun(), PreRun(), and PostRun(), so the majority of implementations of child classes of WorkerRunnable do not need to be changed.

If there are any cases in which the child classes of WorkerThreadRunnable/WorkerParentThreadRunnable want to keep the associated WorkerPrivate, they should use WorkerRefs instead of raw pointers.

Depends on D205679

Differential Revision: https://phabricator.services.mozilla.com/D207039
2024-04-19 09:41:58 +00:00
Eden Chuang
11d8c5840b Bug 1769913 - P2 WorkerParentThreadRunnable for the runnables dispatched to worker's parent thread. r=dom-worker-reviewers,asuth
In this patch, WorkerParentThreadRunnable is extracted from WorkerThreadRunnable for runnable on the parent thread.

WorkerParentControlRunnable and WorkerParentDebuggeeRunnable are also created for control runnable and debuggee runnable on the parent thread.

Instead of using WorkerRunnable::Target to indicate the thread target, inheriting WorkerThreadRunnable or WorkerParentThreadRunnable to point out that this runnable should run on the worker thread or on the parent thread. So WorkerRunnable::Target is removed in this patch.

This patch also move the dispatching logic into WorkerPrivate to simplify WorkerRunnable::DispatchInternal()'s implementation.

Depends on D205178

Differential Revision: https://phabricator.services.mozilla.com/D205679
2024-04-19 09:41:57 +00:00
Denis Palmeiro
5c062218b6 Bug 1887068: Add perfetto event traces for taskcontroller tasks and dom performance measurement markers. r=smaug
Depends on D205662

Differential Revision: https://phabricator.services.mozilla.com/D205663
2024-04-15 15:34:04 +00:00
Cristina Horotan
886fe5f5a4 Backed out 4 changesets (bug 1887068, bug 1890934) on request by causing build bustages
Backed out changeset 68a7a8a3bb0f (bug 1890934)
Backed out changeset 658f4b57b8ec (bug 1887068)
Backed out changeset 61a9d3a1e592 (bug 1887068)
Backed out changeset efbf5c7065e3 (bug 1887068)
2024-04-12 02:14:44 +03:00
Denis Palmeiro
a63122839e Bug 1887068: Add perfetto event traces for taskcontroller tasks and dom performance measurement markers. r=smaug
Depends on D205662

Differential Revision: https://phabricator.services.mozilla.com/D205663
2024-04-10 17:48:08 +00:00
Cristian Tuns
d9503794a6 Backed out 3 changesets (bug 1887068) for causing build bustages in toolkit/* CLOSED TREE
Backed out changeset c6863f012b03 (bug 1887068)
Backed out changeset 3a4d2b74219e (bug 1887068)
Backed out changeset 90a702920d77 (bug 1887068)
2024-04-09 18:19:08 -04:00
Denis Palmeiro
f61b8829df Bug 1887068: Add perfetto event traces for taskcontroller tasks and dom performance measurement markers. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D205663
2024-04-09 19:05:36 +00:00
Markus Stange
510461db11 Bug 1883522 - When running with MOZ_USE_PERFORMANCE_MARKER_FILE=1, mmap the marker file to help out perf + simpleperf + samply. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D203536
2024-03-09 23:04:01 +00:00
Mike Hommey
cb8586c356 Bug 1884021 - Avoid warning about unused startTimeStamp/endTimeStamp in cases not using the values. r=profiler-reviewers,canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D203842
2024-03-07 20:26:03 +00:00
Cristian Tuns
1fbcf051bb Backed out changeset eea5db012489 (bug 1883522) for causing build bustages in Performance.cpp CLOSED TREE 2024-03-05 17:16:25 -05:00
Markus Stange
f3da10359d Bug 1883522 - When running with MOZ_USE_PERFORMANCE_MARKER_FILE=1, mmap the marker file to help out perf + simpleperf + samply. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D203536
2024-03-05 21:34:13 +00:00
Emilio Cobos Álvarez
5b62de6483 Bug 1883435 - Don't include GleanMetrics.h from Document.h. r=chutten,necko-reviewers,valentin
In bug 1883435 comment 2 chutten mentions that including
nsGlobalWindowInner.h from GleanMetrics.h causes a stylo build failure.

This is because nsGlobalWindowInner.h itself brings a bunch of DOM
bindings template soup that bindgen isn't great at dealing with.

That can be fixed in various ways. However, there is a simpler fix,
which is not including GleanMetrics at all.

It's trivial to do, and given it's a massive autogenerated file, and
Document.h is a very common header, it's worth doing this if only for
build times.

Fix a bunch of unused includes while at it.

Differential Revision: https://phabricator.services.mozilla.com/D203625
2024-03-05 17:54:14 +00:00
Timothy Nikkel
cbad7b8e1d Bug 1875426. Remove unused LCPImageEntryKey::Equals. r=emilio
It also contains a consequential typo |mImageRequestProxy == mImageRequestProxy|

Differential Revision: https://phabricator.services.mozilla.com/D199064
2024-03-02 07:56:42 +00:00
Chris H-C
1c0270168b Bug 1877842 - Migrate performance GVST probes r=perry.mcmanis,denispal
Most are brought over straightforwardly, their Telemetry callsites reworded
to use Glean, with mirroring to the Telemetry probes taken care of by the Glean
Interface For Firefox Telemetry (see the telemetry_mirror property).

There were two special cases: PERF_DOM_CONTENT_LOADED_FROM_RESPONSESTART_MS,
and PERF_DOM_CONTENT_LOADED_MS. Both were removed as they were unused.

Differential Revision: https://phabricator.services.mozilla.com/D200867
2024-02-09 21:11:05 +00:00
Sean Feng
e506e5cfea Bug 1877787 - Avoid doing reduced precision computation when generating LCP r=emilio,tjr
When we generate LCP entries, we store the precision-reduced
timestamps which are convenient for later usages, but not very
performant. This patch makes it instead of storing the
precision-reduced timestamps, store the raw timestamps, and only
reduce the precision when they're being used by user code.

Also, this patch changes how we compute precision-reduced timestamps for LCP.
Currently, we effectively use `ReduceTimePrecisionAsMSecsRFPOnly` to
reduce precision which only work in RFP mode. This patch changes it
to `ReduceTimePrecisionAsMSecs` to make it work in 'Normal' mode (i.e.
non-COOP/COEP pages).

Differential Revision: https://phabricator.services.mozilla.com/D200200
2024-02-01 14:30:44 +00:00
Jason Kratzer
dc5aa1700a Bug 1876138: Check if in main thread before attempting to create PerformanceMark. r=dom-worker-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D199384
2024-01-29 17:25:25 +00:00
Markus Stange
1c5624ed94 Bug 1876415 - Make timestamp formats consistent between Jitdump and the marker file. r=glandium
On Linux and Android, both jitdump and the marker file will keep using
`CLOCK_MONOTONIC` nanoseconds, as before.

On macOS, both jitdump and the marker file will now be using
`TimeStamp::RawMachAbsoluteTimeNanoseconds()` , i.e. "nanoseconds since
mach_absolute_time origin".
This value has the advantage that it is also relatively easy to obtain
in other browser engines, because their internal timestamp value is stored
in milliseconds or nanoseconds rather than in `mach_absolute_time` ticks.
In the past, on macOS, Firefox was using `CLOCK_MONOTONIC` nanoseconds for
jitdump and `TimeStamp::RawMachAbsoluteTimeValue()` for the marker file.
This inconsistency is now fixed.
I will update samply to change how it treats jitdump timestamps on macOS.
There are no other consumers of jitdump files on macOS that I know of.

On Windows, we will keep using raw QPC values for the marker file - this
matches what's in the ETW events. Jitdump on Windows is mostly unused but
I'm updating it to match.

Furthermore, this fixes the order in mozglue/misc/moz.build to make sure
we always use the TimeStamp_darwin implementation on Darwin (and not just
due to a broken configure check, see bug 1681445), and it fixes the #ifdef
in TimeStamp.h to match the Darwin check.

Differential Revision: https://phabricator.services.mozilla.com/D199592
2024-01-26 03:38:54 +00:00
Timothy Nikkel
6781eff277 Bug 1875427. Microoptimize in LCPHelpers::CreateLCPEntryForImage. r=emilio,sefeng
Checking if it's a data uri does show up in profiles (not a lot, but it's there), versus calling ShouldReportRenderTimeForLCP which is just returning a bool, so it should be faster.

Differential Revision: https://phabricator.services.mozilla.com/D199065
2024-01-25 07:31:59 +00:00
Doug Thayer
39e9d8ead9 Bug 1811750 - Eliminate redundant array filling in performance.measure r=sefeng
Basically we were falling off a cliff where if we had a bunch of marks recorded
with a particular name, when trying to measure we would fill an array with all
of them only to return the last one. This just replaces that by iterating in
reverse and returning the first matching mark. Arguably we should be using a
hashmap or something here, but this is a quick and trivial improvement that I
think will resolve the reported issue.

Differential Revision: https://phabricator.services.mozilla.com/D199451
2024-01-24 18:02:35 +00:00
Jens Stutte
aa54dcc26f Bug 1875800 - Add name support to WorkerRunnable. r=dom-worker-reviewers,asuth,smaug
Differential Revision: https://phabricator.services.mozilla.com/D199228
2024-01-24 16:00:26 +00:00
Cristian Tuns
5de093dcd2 Backed out changeset f3efca74da0f (bug 1875800) for causing build bustages in WorkerPrivate.cpp CLOSED TREE 2024-01-23 11:20:38 -05:00
Jens Stutte
926a1907f0 Bug 1875800 - Add name support to WorkerRunnable. r=dom-worker-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D199228
2024-01-23 11:23:41 +00:00
Tom Ritter
74b8900fe6 Bug 1873405: Relax an assertion about timing r=sefeng
When RFP is enabled and you're dealing with timestamps of
reduced precision, it's possible for these timestamps to
be equal. Relax the assertion to allow that.

Also, conceptually, it should be <= even without RFP because
you can't guarantee the OS timestamps are going to be reliable
(just increasing) and you can't guarantee anything about how
fast or slow computation is going to happen.

Differential Revision: https://phabricator.services.mozilla.com/D197946
2024-01-10 09:56:52 +00:00
Markus Stange
b9d5afe9e6 Bug 1873244 - Reintroduce a call that was accidentally removed in bug 1869835. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D197810
2024-01-05 19:00:39 +00:00
Bas Schouten
cabef6614e Bug 1869835 - Part 2: Do some code deduplication and convert UserTimingMarker to the new schema. r=mstange,profiler-reviewers
This will allow ETW to collect the additional payload on the UserTiming markers. As well as allow the provider to filter on these markers in order to minimize overhead from other markers that don't need to be collected.

Differential Revision: https://phabricator.services.mozilla.com/D196332
2023-12-21 18:17:41 +00:00
Sean Feng
7d09c7d6c5 Bug 1867623 - Clear some LCP related data early when the window is dying r=smaug
We expect nothing is going to be painted after this point, so
these data are not needed.

Differential Revision: https://phabricator.services.mozilla.com/D195144
2023-12-01 14:13:54 +00:00
Kagami Sascha Rosylight
c1e45850a8 Bug 1862244 - Add GlobalTeardownHelper r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D193295
2023-11-23 17:17:39 +00:00
Sean Feng
6796c871a0 Bug 1864160 - Use weak pointer for LCPImageEntryKey.mImageRequestProxy to avoid keeping image loader alive for unnecessary amount of time r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D193964
2023-11-21 17:46:42 +00:00
Sean Feng
2c6ee1b669 Bug 1863491 - Use weak pointers for LargestContentfulPaint to avoid keeping the element alive for unnecessary period r=emilio,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D193135
2023-11-13 19:20:00 +00:00
Stanca Serban
e473309a4d Backed out changeset cfed378ac68a (bug 1863491) for causing build bustages in PerformanceMainThread.cpp. CLOSED TREE 2023-11-13 18:10:40 +02:00
Sean Feng
62cf4d2ec1 Bug 1863491 - Use weak pointers for LargestContentfulPaint to avoid keeping the element alive for unnecessary period r=emilio,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D193135
2023-11-13 14:33:56 +00:00