[e10s] Input latency in Facebook Messenger/Chat while also animating window




Event Handling
2 years ago
a year ago


(Reporter: delyan.kratunov, Unassigned, NeedInfo)


49 Branch
Mac OS X

Firefox Tracking Flags

(e10s-, platform-rel +)


(Whiteboard: [platform-rel-Facebook][qf])


(1 attachment)



2 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:49.0) Gecko/20100101 Firefox/49.0
Build ID: 20160504043118

Steps to reproduce:

1) Open messenger.com (requires Facebook account)
2) Start a chat with yourself (yes, it's possible)
3) Begin typing in the chat box

Actual results:

The input latency became near seconds the moment the "other party typing" indicator showed up. 

Aside: The latency gets so high in actual usage that there is sometimes no visual feedback while the other party is typing - the entire message appears the moment the animation disappears.

Expected results:

No input latency should have been observed.


2 years ago
OS: Unspecified → Mac OS X
Hardware: Unspecified → x86

Comment 1

2 years ago
This repros on Firefox 49.0a1 (2016-05-04) on OS X
tracking-e10s: --- → ?
delyan, I am unable to reproduce this on Mac 10.11, with latest Nightly.  Can you reproduce in safemode?  if not, please post your about:support.
Flags: needinfo?(delyan.kratunov)

Comment 3

2 years ago
It kinda repros in safe mode but it's not as exacerbated. The weird thing is that it repros *almost* exactly in this configuration - https://pastebin.mozilla.org/8869735 I.e., normal mode but with all the addons manually disabled. 

Video from safe mode: https://dl.dropboxusercontent.com/u/137119/firefox.input.latency.safe.mode.480.mov (1.9MB)

Video from normal mode with addons manually disabled: https://dl.dropboxusercontent.com/u/137119/firefox.typing.lag.normal.addons.disabled.480.mov (790KB)

In the latter video, you can still see firefox struggling with the held down keys but it's not nearly as bad.
Flags: needinfo?(delyan.kratunov)

Comment 4

2 years ago
delyan.kratunov@gmail.com, can you only reproduce this under e10s, or does it reproduce it under non e10s?
Flags: needinfo?(delyan.kratunov)
User Agent  Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:50.0) Gecko/20100101 Firefox/50.0

I was unable to reproduce this issue on the latest Firefox release (47.0) or the latest Nightly (50.0a1, Build ID  20160614030210) because when I start typing the preview didn't appear. I was able to type in the window without any input lag.

How do you make that "preview" of what you are typing appear? Because it seems to me like that might cause this strange behavior.
Flags: needinfo?(delyan.kratunov) → needinfo?(twalker)
Flags: needinfo?(delyan.kratunov)
Whiteboard: [platform-rel-Facebook]


2 years ago
platform-rel: --- → ?
Interesting, I can no longer get the "preview" text either.  Perhaps facebook removed this feature?

delyan, are you still seeing the preview text?
Flags: needinfo?(twalker)

Comment 7

2 years ago
The typing indicator appears to be looking for space characters to show up. I still see abysmal keystroke-to-update performance, under e10s, when typing gibberish in a thread with myself, with a lot of space characters.

As a sanity check, Chrome performs notably better.

How do I collect a trace with enough information for you guys to diagnose?
Component: Untriaged → Event Handling
Product: Firefox → Core


2 years ago
platform-rel: ? → +
Olli, what can we do to profile the lag here?
Flags: needinfo?(bugs)
Just any profiling should show where the time is spent, and hint why main event loop isn't fast enough.

I'm not familiar with messenger.com, but let me see if I can figure out what to do there.
Flags: needinfo?(bugs)
On linux I don't see any latency.

Child process uses time in JS, reflow/layout and painting.
Looks like the page is forcing synchronous reflow quite often, but those aren't taking too much time.

Parent process takes reasonable little cpu time.

Reporter, could you perhaps try Gecko profiler addon and capture a profile when this is happening?
Using Nightly for profiling would be the best, but any version of FF is fine.


2 years ago
tracking-e10s: ? → -
Flags: needinfo?(ryanvm)
Maybe we can try to get a profile here?
Flags: needinfo?(ryanvm) → needinfo?(rares.bologa)
Created attachment 8776562 [details]
sending multiple short messages.mp4

User Agent:  Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:50.0) Gecko/20100101 Firefox/50.0

I have noticed a small delay when typing fast in the messenger text field on both OS's, but I encountered it randomly and only for short periods. Also, as Tracy said it seems that the "preview" animation is no longer displayed when typing. 
I have tested this issue on the latest Nightly (50.0a1 - Build ID 20160731030203) build on Windows 7 x64 and Mac OS 10.10.

I got profiles for both OS's and these are the results: 
- Mac Os 10.10: https://cleopatra.io/#report=933739461fa7afb3cc951c6e8f379a014bbc090a
- Windows 7 x64: https://cleopatra.io/#report=c7b4c83034c63705d4ab8454e7835d591db476e5

However, I have observed a similar behavior while sending multiple short messages. I have also tested this in Chrome but there is no delay when doing this.
I have attached for this scenario a screen recording.

Also, Delyan can you please try to get a profile like I did and Olli suggested in comment 10, so we can compere the results?
Flags: needinfo?(rares.bologa)
Flags: needinfo?(delyan.kratunov)
Flags: needinfo?(delyan.kratunov)


2 years ago
Rank: 20
Whiteboard: [platform-rel-Facebook] → [platform-rel-Facebook][qf]
FWIW just I tried in Nightly on Windows and things seemed pretty good to me.

Comment 14

a year ago
This needs to be reprofiled...
Flags: needinfo?(overholt)
(In reply to delyan.kratunov from comment #0)
> 1) Open messenger.com (requires Facebook account)
> 2) Start a chat with yourself (yes, it's possible)
> 3) Begin typing in the chat box
> Actual results:
> The input latency became near seconds the moment the "other party typing"
> indicator showed up. 

I see the little "..." indicating the other party is typing but I don't see any latency.

Here's a profile taken on an Acer Aspire E15 running the 2017-05-08 Nightly on Windows 10 of me chatting with myself: https://perfht.ml/2q9VGRH and here's one chatting with someone else: https://perfht.ml/2q9FzmW.
Flags: needinfo?(overholt)
Last Resolved: a year ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.