Commit Graph

575 Commits

Author SHA1 Message Date
Denis Palmeiro
d8116c28e2 Bug 1671729 - Gather telemetry on page load and request animation frame callback time r=bas,smaug,Dexter
Current page load telemetry probes are insufficient in performance RUM testing.  FX_PAGE_LOAD_MS_2 will stop the timer when the user switches tabs or navigates off the page, while the current navigation probes include all content including about:blank, about:newtab, moz-extension, etc.  This patch adds support for the following probes which do not suffer from those limitations:

PERF_PAGE_LOAD_TIME_MS
PERF_PAGE_LOAD_TIME_FROM_RESPONSESTART_MS
PERF_DOM_CONTENT_LOADED_TIME_MS
PERF_DOM_CONTENT_LOADED_TIME_FROM_RESPONSESTART_MS
PERF_FIRST_CONTENTFUL_PAINT_MS
PERF_FIRST_CONTENTFUL_PAINT_FROM_RESPONSESTART_MS
PERF_REQUEST_ANIMATION_CALLBACK_PAGELOAD_MS
PERF_REQUEST_ANIMATION_CALLBACK_NON_PAGELOAD_MS

Differential Revision: https://phabricator.services.mozilla.com/D94004
2020-10-21 16:27:30 +00:00
Botond Ballo
071d29be49 Bug 1667475 - Moved displayport-related functions from nsLayoutUtils to a new DisplayPortUtils class. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D92006
2020-10-03 21:07:34 +00:00
Gerald Squelart
313fddf4f9 Bug 1667915 - Separate marker category from marker options - r=gregtatum
The `category.WithOptions(...)` syntax was a bit strange and difficult to explain.

Now the category and options are separate parameters. Default options can be specified with `MarkerOptions{}` or just `{}`.

As a special case, defaulted-NoPayload functions don't need `<>`, and defaulted-NoPayload functions and macros don't even need `{}` for default options, e.g.:
`profiler_add_marker("name", OTHER); PROFILER_MARKER_UNTYPED("name", OTHER);`

Differential Revision: https://phabricator.services.mozilla.com/D91680
2020-10-01 11:02:23 +00:00
Bogdan Tara
6fe40f83f1 Backed out 2 changesets (bug 1667915) for platform related bustage CLOSED TREE
Backed out changeset e7a0788a1741 (bug 1667915)
Backed out changeset d34505b2d81b (bug 1667915)
2020-10-01 12:34:39 +03:00
Gerald Squelart
4eb5bd3574 Bug 1667915 - Separate marker category from marker options - r=gregtatum
The `category.WithOptions(...)` syntax was a bit strange and difficult to explain.

Now the category and options are separate parameters. Default options can be specified with `MarkerOptions{}` or just `{}`.

As a special case, defaulted-NoPayload functions don't need `<>`, and defaulted-NoPayload functions and macros don't even need `{}` for default options, e.g.:
`profiler_add_marker("name", OTHER); PROFILER_MARKER_UNTYPED("name", OTHER);`

Differential Revision: https://phabricator.services.mozilla.com/D91680
2020-10-01 01:44:47 +00:00
Markus Stange
4e4695a367 Bug 1666617 - Fix a typo in the word viewport. r=smaug
Depends on D91379

Differential Revision: https://phabricator.services.mozilla.com/D91380
2020-09-25 09:24:50 +00:00
Markus Stange
155b908c30 Bug 1666617 - Add refresh observer descriptions to the RefreshDriverTick markers. r=smaug
Depends on D91082

Differential Revision: https://phabricator.services.mozilla.com/D91379
2020-09-25 11:42:35 +00:00
Markus Stange
2af8f742d6 Bug 1666617 - Add an observer description argument to AddRefreshObserver. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D91082
2020-09-25 02:36:29 +00:00
Florian Quèze
94f912b9c8 Bug 1666617 - Add RefreshObserver profiler markers, r=smaug
This creates a marker that starts when an observer is added and ends when it is removed.
If there are multiple observers at the same time, their markers overlap.

The current profiler markers API only lets us insert the marker once we know
both the start and the end timestamp. This means that, if a profile is captured
in the middle of a refresh observer's observation period, there will not be a
marker for that observer in the profile. This can be improved once we have a way
to emit separate start and end markers and a way to associate the correct markers
with each other (bug 1661114).

Differential Revision: https://phabricator.services.mozilla.com/D91059
2020-09-25 11:51:06 +00:00
Bas Schouten
e6918b941c Bug 1661881 - Part 4: Prevent additional event loop churn for NotifyVsync when in the child process. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D90863
2020-09-21 14:00:07 +00:00
Dorel Luca
dce635f898 Backed out 10 changesets (bug 1518999) for GeckoView failures in PanZoomControllerTest.scroll. CLOSED TREE
Backed out changeset 7b5bdd071d05 (bug 1518999)
Backed out changeset 401e488734dd (bug 1518999)
Backed out changeset c13e51e17329 (bug 1518999)
Backed out changeset 2a2d67ba15b8 (bug 1518999)
Backed out changeset 3d4d84003227 (bug 1518999)
Backed out changeset 972731762965 (bug 1518999)
Backed out changeset f21b13582dad (bug 1518999)
Backed out changeset 13a4c749a802 (bug 1518999)
Backed out changeset 5a6cea5fd344 (bug 1518999)
Backed out changeset c3bb552e76a3 (bug 1518999)
2020-09-17 02:58:34 +03:00
Sean Feng
c41ea25bf1 Bug 1518999 - Update ContentfulPaint algorithm to follow the spec r=emilio
This patch includes a couple of changes.
1) Notify contentful paint only during refresh driver ticks.
2) Not only the root document, sub document should also have their own
   contentful paint entry.
3) Consider invisible text as contentful as well.

Differential Revision: https://phabricator.services.mozilla.com/D89498
2020-09-14 18:47:34 +00:00
Bas Schouten
1490debc0d Bug 1661881 - Part 3: Make RefreshDriver's tick call SetInputHandlingStartTime directly. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D89536
2020-09-14 12:13:13 +00:00
Gerald Squelart
e68ad94607 Bug 1663554 - Convert AUTO_PROFILER_TEXT_MARKER_... to new AUTO_PROFILER_MARKER_TEXT - r=gregtatum
The name `AUTO_PROFILER_MARKER_TEXT` is more consistent with the equivalent non-`AUTO` macro, and similarly arguments have been re-ordered to be the same, i.e.: Name, category&options, text.

The different macros with different argument sets can now be collapsed into one macro, and the optional arguments (timing, inner window id, backtrace) can easily be added to the `MarkerOptions` where needed.

As a bonus, a specific start time can optionally be provided at construction time.

Differential Revision: https://phabricator.services.mozilla.com/D89588
2020-09-11 00:42:51 +00:00
Gerald Squelart
33d541f8bf Bug 1663543 - Convert PROFILER_ADD_MARKER and 2-arg profiler_add_marker to PROFILER_MARKER_UNTYPED - r=gregtatum
Mostly mechanical change, with some extra work where non-literal names are provided.
Also, when this is the only profiler call in a file, `#include "GeckoProfiler.h"` can be changed to `#include "mozilla/ProfilerMarkers.h"`.

Differential Revision: https://phabricator.services.mozilla.com/D89415
2020-09-10 03:02:36 +00:00
Emilio Cobos Álvarez
b60b3eb19c Bug 1662277 - Make IntersectionObserver entries have the same timestamp as other timestamp-returning things during the "update the rendering steps". r=sefeng
This is per spec, see the link in the test. I wouldn't see much point on
doing this for IntersectionObserver on its own, see:

  https://bugzilla.mozilla.org/show_bug.cgi?id=1518999#c28

Though I see the point of doing this for the paint timing API, and I
guess for consistency we should do it here too.

Differential Revision: https://phabricator.services.mozilla.com/D88926
2020-09-01 15:02:54 +00:00
Honza Bambas
661ab0a0b1 Bug 1657974 - MOZ_LOG schedule and run of FrameRequestCallback, r=froydnj
Depends on D86740

Differential Revision: https://phabricator.services.mozilla.com/D86741
2020-08-13 14:41:16 +00:00
Honza Bambas
c7e4bb5178 Bug 1657960 - MOZ_LOG schedule and run of mStyleFlushObservers and mLayoutFlushObservers, r=froydnj
Depends on D86737

Differential Revision: https://phabricator.services.mozilla.com/D86738
2020-08-13 14:41:15 +00:00
Simon Giesecke
1fbb2b245e Bug 1654992 - Use std::move instead of SwapElements where possible. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D84807
2020-08-04 11:27:07 +00:00
Noemi Erli
c5adcfe981 Backed out 4 changesets (bug 1654992, bug 1654991) for causing timeous in mask-opacity-1e.html
Backed out changeset 11f0f54c6e0a (bug 1654992)
Backed out changeset a353dd5b3f08 (bug 1654991)
Backed out changeset 6a7964ba549f (bug 1654991)
Backed out changeset cf3bfb91d98c (bug 1654991)
2020-08-03 22:09:36 +03:00
Simon Giesecke
9d2e516112 Bug 1654992 - Use std::move instead of SwapElements where possible. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D84807
2020-08-03 14:54:18 +00:00
Markus Stange
ef731aae4a Bug 1656331 - Create a TickReasons bitfield and add the tick reasons to the RefreshDriverTick profiler marker. r=smaug
Example profile: https://share.firefox.dev/2P7QpqL

Differential Revision: https://phabricator.services.mozilla.com/D85458
2020-07-31 23:06:10 +00:00
Markus Stange
7f0ffeda3d Bug 1656331 - Capture a cause callstack in EnsureTimerStarted() and insert the RefreshDriverTick marker in a different place. r=smaug
We can have markers with empty cause stacks, if we keep the timer running
without calling EnsureTimerStarted() again.

Differential Revision: https://phabricator.services.mozilla.com/D85457
2020-07-31 23:04:54 +00:00
Markus Stange
940f8d8681 Bug 1656331 - Factor out nsRefreshDriver::HasReasonToTick() and ShouldKeepTimerRunningWhileWaitingForFirstContentfulPaint(). r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D85456
2020-07-31 23:04:30 +00:00
Chris Liu
4b316ab74a Bug 1494838 - Add a profiler marker with a cause stack for paints (view manager flushes). r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D85455
2020-08-01 00:55:57 +00:00
Emilio Cobos Álvarez
47634b1c9e Bug 1653011 - Simplify and make WeakPtr<Derived> usable and compact. r=froydnj,sg,geckoview-reviewers,jgilbert,kvark,snorp
Having two classes in the inheritance chain inherit from SupportsWeakPtr
now won't compile, but you can use WeakPtr<Derived> when any base class
inherits from SupportsWeakPtr.

Differential Revision: https://phabricator.services.mozilla.com/D83674
2020-07-23 14:51:46 +00:00
Simon Giesecke
a69d79b6db Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00
Simon Giesecke
5c191910fa Bug 1645339 - Use range-based for with nsTObserverArray in layout/base. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D79497
2020-06-17 15:02:57 +00:00
Kenny Levinsen
05fb686a45 Bug 1641033 - nsRefreshDriver vsync observer should always post task to main thread. r=jrmuizel
nsRefreshDriver's NotifyVsync method had some slightly convoluted logic: Based on the thread it is called from, it would guess whether it is called from a vsync source, in which case it would schedule itself onto the main thread, or from the self-scheduled task, in which case it would perform work.

This just splits the two: NotifyVsync only takes care of VsyncSource, and schedules a task that calls the tick logic. This also allows Wayland to run the VsyncSource off the main thread.

Differential Revision: https://phabricator.services.mozilla.com/D77044
2020-06-04 10:43:19 +00:00
Simon Giesecke
1620f338ff Bug 1626570 - Improve handling of copying arrays in layout/base/. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D72354
2020-05-05 10:40:24 +00:00
Razvan Maries
09f4754f5a Backed out 10 changesets (bug 1626570) for build bustages. CLOSED TREE
Backed out changeset a3f17d392234 (bug 1626570)
Backed out changeset 5247e1ddd5d6 (bug 1626570)
Backed out changeset c339fd44c9f8 (bug 1626570)
Backed out changeset 4c69a4c013b3 (bug 1626570)
Backed out changeset e85450d69351 (bug 1626570)
Backed out changeset 793f978248b3 (bug 1626570)
Backed out changeset 68b4c2418d83 (bug 1626570)
Backed out changeset 52d0911d4ad3 (bug 1626570)
Backed out changeset a7d4e3a59ee3 (bug 1626570)
Backed out changeset 6c06d397a5d2 (bug 1626570)
2020-05-05 13:37:08 +03:00
Simon Giesecke
78d86ffa44 Bug 1626570 - Improve handling of copying arrays in layout/base/. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D72354
2020-05-05 09:51:07 +00:00
Cameron McCormack
9326b31020 Bug 1629350 - Don't warn when trying to get a widget-specific vsync source. r=lsalzman
This tends to happen in content processes only, but per the commit
message from bug 1542808, we don't provide a widget-specific vsync
source in content processes currently.

Differential Revision: https://phabricator.services.mozilla.com/D70641
2020-04-14 18:42:30 +00:00
Tom Tung
2363cf75eb Bug 1586761 - P7 - Revert a few incorrect changes on P2; r=tjr
P2 removed IsTimerPrecisionReductionEnabled and thus removed the check for RFP
pref. While most ReduceTimePrecision* functions are fine with that because
GetTimerPrecisionType checks that, the two ReduceTimePrecision*RFP functions
miss the check.

This patch mainly cover the check for that two functions and rename them to
*RFPOnly since they only use RFP when the pref is on.

Depends on D64324

Differential Revision: https://phabricator.services.mozilla.com/D66734
2020-04-07 07:36:52 +00:00
Tom Tung
6783ea5ae8 Bug 1586761 - P2 - Introduce new TimerPrecisionTypes and a set of new Reduce methods to decide the TimerPrecisionType in the nsRFPService; r=tjr
To support checking CrossOriginIsolated in performance.now(), we need to:
- Add new types to TimerPrecisionType for nsRFPService
  - System, HighResAllowed are added
  - All is renamed to Normal
- Introduce a set of Reduce methods which require isSystemPrincipal and
CrossOriginIsolated to be passed and decide the TimerPrecisionType later
  - Original Reduce methods should only be called when callsites know the
  TimerPrecisionType. Otherwise, they should call the new methods.
- The following patches will use new methods

Differential Revision: https://phabricator.services.mozilla.com/D63293
2020-03-25 14:09:55 +00:00
Emilio Cobos Álvarez
66ff09f01e Bug 1624829 - Use FunctionRef for various Enumerate* callbacks. r=edgar
This avoids a bunch of ugly casts and void pointers, without much overhead
(unlike std::function or such).

Differential Revision: https://phabricator.services.mozilla.com/D68182
2020-03-26 12:44:47 +00:00
Olli Pettay
ca98081dca Bug 1617111, reduce the time forced to be used outside animation frame callbacks, r=farre
Differential Revision: https://phabricator.services.mozilla.com/D67123
2020-03-18 08:31:44 +00:00
Simon Giesecke
e613597e90 Bug 1613985 - Use default for equivalent-to-default constructors/destructors in layout. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D66016
2020-03-17 09:38:32 +00:00
Kenny Levinsen
f56fa476f4 Bug 1614212 - Migrate global VsyncSource users correctly on frame rate change r=sotaro
CompositorVsyncDispatcher holds a reference to the VsyncSource, so it must be informed on change.

Differential Revision: https://phabricator.services.mozilla.com/D65878
2020-03-16 23:24:39 +00:00
Coroiu Cristina
285b8c2029 Backed out changeset ef75f461147c (bug 1614212) for GTest failures 2020-03-16 03:52:15 +02:00
Kenny Levinsen
e6a04c95cf Bug 1614212 - Migrate global VsyncSource users correctly on frame rate change r=sotaro
CompositorVsyncDispatcher holds a reference to the VsyncSource, so it must be informed on change.

Differential Revision: https://phabricator.services.mozilla.com/D65878
2020-03-16 00:05:20 +00:00
Mihai Alexandru Michis
7d8922750d Backed out changeset 8bc3cd786136 (bug 1614212) for causing leaks.
CLOSED TREE
2020-03-13 19:21:34 +02:00
Kenny Levinsen
8de81e9a78 Bug 1614212 - Migrate global VsyncSource users correctly on frame rate change r=sotaro
CompositorVsyncDispatcher holds a reference to the VsyncSource, so it must be informed on change.

Differential Revision: https://phabricator.services.mozilla.com/D65878
2020-03-13 16:04:36 +00:00
Boris Zbarsky
8b76288352 Bug 1535530. Fix can-run-script analysis to not mishandle on-stack refs to RefPtrs. r=andi,masayuki
The key here is to test the type of the variable declaration for being a
smartptr type, instead of testing the type of the variable _use_.

Differential Revision: https://phabricator.services.mozilla.com/D65581
2020-03-06 09:57:45 +00:00
Steven MacLeod
8d105719a5 Bug 1597482 - Replace nsIDocShellTreeItem with BrowsingContext in GetProfileTimelineSubDocShells. r=mstange
`GetProfileTimelineSubDocShells` was using nsIDocShellTreeItem to walk the
DocShells that are visible and recording profile markers. This change switches
to using `BrowsingContext` for the walk, and ignores OOP iframes as they aren't
painting in the current process.

Differential Revision: https://phabricator.services.mozilla.com/D63960
2020-02-27 19:26:40 +00:00
Sylvestre Ledru
230ce836cb Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan,kvark
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D63787
2020-02-24 15:33:38 +00:00
Olli Pettay
d5e05ed084 Bug 1615607 - Consider to always treat high priority runnables as the highest priority runnables, r=farre
The patch removes the tad odd interleave behavior from the main thread and makes RefreshDriver to give
at least a tiny bit time for non-high priority tasks.
Given the recent change to have similar block-until behavior in child and parent process, this should work
consistently in all the processes.

Differential Revision: https://phabricator.services.mozilla.com/D63098
2020-02-18 16:03:37 +00:00
Olli Pettay
5c56d72f78 Bug 1506376, make parent process vsync handling to be blocked the same way as in child process r=farre
Because the code becomes more generic, the following renames are done:
mLastChildTick is renamed to mLastTick
mLastProcessedTickInChildProcess is renamed to mLastProcessedTick

To clarify which member variables are used in parent process only
mRefreshTickLock is renamed to mParentProcessRefreshTickLock and
new variables mRecentParentProcessVsync and mPendingParentProcessVsync are
added. (mRecentVsync and mRecentVsyncId don't anymore have the different
behavior in parent and child processes)

The basic idea is to keep the vsync compression in parent process in
NotifyVsync.
(In child processes it is handled by IPDL/IPC compression).
The main functionality change is in ParentProcessVsyncNotifier::Run.
That method doesn't anymore call mObserver->TickRefreshDriver(...)
but mObserver->NotifyParentProcessVsync(...), which then calls
NotifyVsync(...) on the main thread. That way parent process gets the
same vsync block-until behavior as what child process has.

Depends on D62032

Differential Revision: https://phabricator.services.mozilla.com/D62033
2020-02-14 16:28:22 +00:00
Bogdan Tara
f366befbe0 Backed out 3 changesets (bug 1506376) for xpcshell failures CLOSED TREE
Backed out changeset fe7215eefa28 (bug 1506376)
Backed out changeset 621ec02db41c (bug 1506376)
Backed out changeset adbd602610a3 (bug 1506376)
2020-02-14 17:07:49 +02:00
Olli Pettay
4566d54433 Bug 1506376, make parent process vsync handling to be blocked the same way as in child process r=farre
Because the code becomes more generic, the following renames are done:
mLastChildTick is renamed to mLastTick
mLastProcessedTickInChildProcess is renamed to mLastProcessedTick

To clarify which member variables are used in parent process only
mRefreshTickLock is renamed to mParentProcessRefreshTickLock and
new variables mRecentParentProcessVsync and mPendingParentProcessVsync are
added. (mRecentVsync and mRecentVsyncId don't anymore have the different
behavior in parent and child processes)

The basic idea is to keep the vsync compression in parent process in
NotifyVsync.
(In child processes it is handled by IPDL/IPC compression).
The main functionality change is in ParentProcessVsyncNotifier::Run.
That method doesn't anymore call mObserver->TickRefreshDriver(...)
but mObserver->NotifyParentProcessVsync(...), which then calls
NotifyVsync(...) on the main thread. That way parent process gets the
same vsync block-until behavior as what child process has.

Depends on D62032

Differential Revision: https://phabricator.services.mozilla.com/D62033
2020-02-14 13:55:35 +00:00