The default bug view has changed. See this FAQ.

Include paint time in tab switch telemetry

RESOLVED FIXED in Firefox 18

Status

()

Core
Graphics
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: jrmuizel, Assigned: jrmuizel)

Tracking

unspecified
mozilla19
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(firefox18 fixed)

Details

(Whiteboard: [snappy])

Attachments

(1 attachment, 3 obsolete attachments)

(Assignee)

Description

5 years ago
The current telemetry doesn't include paint time.
(Assignee)

Comment 1

5 years ago
Created attachment 670030 [details] [diff] [review]
Include paint time in tabswitch telemetry

This will look something like this.
(Assignee)

Updated

5 years ago
Whiteboard: [snappy]
(Assignee)

Comment 2

5 years ago
Created attachment 670038 [details] [diff] [review]
A working version
Attachment #670030 - Attachment is obsolete: true
Attachment #670038 - Flags: review?(dao)
Attachment #670038 - Flags: review?(bjacob)
Comment on attachment 670038 [details] [diff] [review]
A working version

>--- a/browser/base/content/tabbrowser.xml
>+++ b/browser/base/content/tabbrowser.xml
>@@ -831,18 +831,21 @@
>       <method name="updateCurrentBrowser">
>         <parameter name="aForceUpdate"/>
>         <body>
>           <![CDATA[
>             var newBrowser = this.getBrowserAtIndex(this.tabContainer.selectedIndex);
>             if (this.mCurrentBrowser == newBrowser && !aForceUpdate)
>               return;
> 
>-            if (!aForceUpdate)
>+            if (!aForceUpdate) {
>               TelemetryStopwatch.start("FX_TAB_SWITCH_UPDATE_MS");
>+              this.mCurrentBrowser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor).
>+                              getInterface(Ci.nsIDOMWindowUtils).beginTabSwitch();
>+            }

Calling beginTabSwitch on the content window that's becoming inactive doesn't make much sense to me. this.mCurrentBrowser is the previously selected browser here, newBrowser is the new one.
Comment on attachment 670038 [details] [diff] [review]
A working version

Review of attachment 670038 [details] [diff] [review]:
-----------------------------------------------------------------

I only reviewed the gfx/ files. Not competent for other directories.

Even for that, I need an explanation about 'frame time recording':

::: gfx/layers/Layers.cpp
@@ +878,5 @@
>      mLastFrameTime = now;
>    }
> +  if (!mTabSwitchStart.IsNull()) {
> +    Telemetry::Accumulate(Telemetry::FX_TAB_SWITCH_TOTAL_MS,
> +                          int32_t((TimeStamp::Now() - mTabSwitchStart).ToMilliseconds()));

No need for this explicit int32_t cast. If a cast were needed, which it isn't AFAICS, that would be to uint32_t.

::: gfx/layers/basic/BasicLayerManager.cpp
@@ +589,5 @@
>        PaintLayer(mTarget, mRoot, aCallback, aCallbackData, nullptr);
>        if (mWidget) {
>          FlashWidgetUpdateArea(mTarget);
>        }
> +      LayerManager::PostPresent();

Apparently PostPresent() is already used for "frame time recording". Explain to me how adding this call isn't going to change the results of frame time recording if it was enabled -- or how this change is wanted.
Attachment #670038 - Flags: review?(bjacob) → review-
(Assignee)

Comment 5

5 years ago
Created attachment 670044 [details] [diff] [review]
Use newBrowser instead
Attachment #670038 - Attachment is obsolete: true
Attachment #670038 - Flags: review?(dao)
Attachment #670044 - Flags: review?(dao)
Attachment #670044 - Flags: review?(bjacob)
(Assignee)

Comment 6

5 years ago
(In reply to Benoit Jacob [:bjacob] from comment #4)
> 
> No need for this explicit int32_t cast. If a cast were needed, which it
> isn't AFAICS, that would be to uint32_t.

Fixed.

> ::: gfx/layers/basic/BasicLayerManager.cpp
> @@ +589,5 @@
> >        PaintLayer(mTarget, mRoot, aCallback, aCallbackData, nullptr);
> >        if (mWidget) {
> >          FlashWidgetUpdateArea(mTarget);
> >        }
> > +      LayerManager::PostPresent();
> 
> Apparently PostPresent() is already used for "frame time recording". Explain
> to me how adding this call isn't going to change the results of frame time
> recording if it was enabled -- or how this change is wanted.

Previously, PostPresent wasn't called by the basic layer manager. This meant that frame time recording didn't work with that layer manager.
(Assignee)

Comment 7

5 years ago
Created attachment 670050 [details] [diff] [review]
V3

Addresses Benoit's comments and a comment to the idl and changes the uuid.
Attachment #670044 - Attachment is obsolete: true
Attachment #670044 - Flags: review?(dao)
Attachment #670044 - Flags: review?(bjacob)
Attachment #670050 - Flags: review?(ehsan)
Attachment #670050 - Flags: review?(dao)
Comment on attachment 670050 [details] [diff] [review]
V3

Review of attachment 670050 [details] [diff] [review]:
-----------------------------------------------------------------

r=me on the domwindowutils dumpster.  ;-)
Attachment #670050 - Flags: review?(ehsan) → review+
Comment on attachment 670050 [details] [diff] [review]
V3

>+              newBrowser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor).
>+                              getInterface(Ci.nsIDOMWindowUtils).beginTabSwitch();

formatting nit:

              newBrowser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor)
                        .getInterface(Ci.nsIDOMWindowUtils).beginTabSwitch();

>   "FX_TAB_SWITCH_UPDATE_MS": {
>     "kind": "exponential",
>     "high": "1000",
>     "n_buckets": 20,
>     "description": "Firefox: Time in ms spent updating UI in response to a tab switch"
>   },
>+  "FX_TAB_SWITCH_TOTAL_MS": {
>+    "kind": "exponential",
>+    "high": "1000",
>+    "n_buckets": 20,
>+    "description": "Firefox: Time in ms spent updating UI in response to a tab switch"
>+  },

Can you add to the description that this includes painting time?

Should we get rid of FX_TAB_SWITCH_UPDATE_MS?
Attachment #670050 - Flags: review?(dao) → review+
https://hg.mozilla.org/mozilla-central/rev/155f7491ad68
Assignee: nobody → jmuizelaar
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19

Updated

5 years ago
Duplicate of this bug: 790752
(In reply to Dão Gottwald [:dao] from comment #9)
> Should we get rid of FX_TAB_SWITCH_UPDATE_MS?

I think it's probably useful to have both numbers.
(Assignee)

Comment 13

5 years ago
Comment on attachment 670050 [details] [diff] [review]
V3

[Approval Request Comment]
Bug caused by (feature/regressing bug #): We would like this so we can compare tab switch performance between 18 and 19.
User impact if declined: Minimal
Testing completed (on m-c, etc.): Has been on mozilla-central for about a wekk.
Risk to taking this patch (and alternatives if risky): There should be no behaviour change. The only things that came up during testing were an exception being caused by beginTabSwitch() this had very obvious side effects and shouldn't be happening at all anymore.
String or UUID changes made by this patch: None
Attachment #670050 - Flags: approval-mozilla-aurora?

Updated

5 years ago
Attachment #670050 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
(Assignee)

Comment 14

5 years ago
https://hg.mozilla.org/releases/mozilla-aurora/rev/868d886d3616

Updated

5 years ago
status-firefox18: --- → fixed
You need to log in before you can comment on or make changes to this bug.