Closed Bug 1579596 Opened 5 years ago Closed 4 years ago

Keyboard input is extremely laggy on twitter.com

Categories

(Core :: Layout: Flexbox, defect, P2)

71 Branch
Desktop
Windows 10
defect

Tracking

()

RESOLVED WORKSFORME
Performance Impact high
Tracking Status
firefox70 + wontfix
firefox71 --- wontfix
firefox72 --- wontfix
firefox73 --- wontfix
firefox74 --- wontfix
firefox75 --- wontfix
firefox76 --- verified

People

(Reporter: alice0775, Unassigned)

References

(Blocks 1 open bug, Regression)

Details

(4 keywords)

Attachments

(4 files)

Attached file about:support

This seems a recent regression.

Reproducible: often

Steps To Reproduce:

  1. Open https://twitter.com/home
  2. Keyboard input several character to "What's happening?"
    e.g,. aaaa aa aaa aaaa aa aaa aaaa aa aaa aaaaa aa aaa

Actual Results:
Super laggy

Expected Results:
not laggy

Gecko Profiler log: https://perfht.ml/2A0RB86

Has Regression Range: yes → ---
Product: Firefox Build System → Core
No longer regressed by: 1572216

Steps to reproduce:

  1. Open the attached reduced html
  2. Click just after "Click here "
  3. Keydown [Back Space] and keep hold until the field is emptied
  4. keydown [a] and keep hold until "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  5. Repeat from step 3 (5-10times)

Actual Results:
Becomes super laggy

In the attached reduced testcase, at least two major regressions seem to be there.
#1, key input slowdown after repeat step3 5 times
#2, key input super laggy after repeat step3 more 3 times

#1 regression window:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=e07c0fe7189bd39dd52625006a29edbcac2e9750&tochange=c2141e08383873f70201cc84613ef5904cb27d07

#2 regression window:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=d7b5e712bf67506589579e37c162590064e5d950&tochange=c51ba76790c01fe9c00aa4a03ea2f6d3aa397286

Marking 70 as affected given the regression range, Mike could the patches in bug 1573566 have caused this regression?

Flags: needinfo?(mh+mozilla)
Whiteboard: [qf]
Product: Core → Firefox
See Also: → 1579929
Regressed by: 1572216

dholbert, could you take a look at the profile. There is some deep flexbox reflow happening.

regression ranges do look surprising.

Flags: needinfo?(dholbert)

This sounds a lot like bug 1527786, though we had trouble reproducing the bug there. (So far I haven't been able to reproduce here, either... just tried STR from comment 3 but didn't hit any lag. Perhaps I didn't repeat enough times.)

I'm backed up on requests right now but will hopefully get a chance to look at this within a couple days.

Flags: needinfo?(dholbert)
See Also: → 1527786

Tracking for 71 as it impacts a major site.

Given the profile shows this is happening in layout, let's move there at least for the time being.

Component: General → Layout
Product: Firefox → Core

Bug 1579502 presumably fixed #2.

#1 is unexpected... it would imply that LTO during PGO generate matters?!

Flags: needinfo?(mh+mozilla) → needinfo?(nfroyd)
See Also: → 1580582
Whiteboard: [qf] → [qf:p1:responsiveness]

(In reply to Mike Hommey [:glandium] from comment #9)

Bug 1579502 presumably fixed #2.

#1 is unexpected... it would imply that LTO during PGO generate matters?!

I guess if you're not PGO use'ing with the same settings that you're PGO generate'ing, that would eventually manifest as a problem? Did we have problems with doing LTO during PGO generate, or was that just done in the interest of trying to save time during builds?

Flags: needinfo?(nfroyd)
Flags: needinfo?(mh+mozilla)

The latter.

Flags: needinfo?(mh+mozilla)
Priority: -- → P2

Tracking, if you come up with a solution we could still take a patch in 70.

Flags: needinfo?(svoisen)

Andrei, can you help find someone to try and replicate this ? Thanks!

Flags: needinfo?(andrei.vaida)

So, I tried reproducing this issue by STR from Comment 0 and Comment 3 respectively, but had no success.

On the other hand, the method I successfully was able to reproduce the lagginess can be seen in the screencast attached. Shortly, keep pressed A letter and fast right click two or three times over the letters. This will make Twitter get laggy and the second effect of this is that it will register the letters, but can't delete them by any means.

This was done on Windows 10 (x64) 1903, and on Nightly 71.0a1 (2019-09-06).

Please let me know if I can be of any help further.

Flags: needinfo?(andrei.vaida)
Attached image Aaaaaa.gif

Here is the attachment.

Given the difficulty of reproduction, I'm going to mark this fix-optional in 70. We will keep investigating for now.

Flags: needinfo?(svoisen)

Nightly72.0a1(20191104214406) hang up when delete input text.
https://perfht.ml/2WKbt9Z

This might be the same core issue as bug 1579929 - this could be a large interruptible reflow, which is getting interrupted by the user-input-event (the character press and/or delete), which then causes cached flex-item measurements to be purged which makes the rest of the reflow unintentionally expensive to complete as described in bug 1579929 comment 29.

Alice0775, would you mind testing to see if this is fixed in the latest Nightly?

I'm hoping that the same patches that fixed bug 1579929 will have fixed this, too.
[EDIT: sorry, I initially left out a digit in that bug number; I've edited the comment in-place to fix.]

Flags: needinfo?(alice0775)

(In reply to Daniel Holbert [:dholbert] from comment #20)

Alice0775, would you mind testing to see if this is fixed in the latest Nightly?

I'm hoping that the same patches that fixed bug 1579929 will have fixed this, too.
[EDIT: sorry, I initially left out a digit in that bug number; I've edited the comment in-place to fix.]

uum, I can still reproduce the issue on Nightly72.0a1 20191119043902. Keyboard input is super laggy.
(However, I cannot reproduce on Beta71.0b10.)

Flags: needinfo?(alice0775)

https://perfht.ml/332hLU3 on Nightly72.0a1 20191119043902

OK, thanks for checking (and for the profile). Looks like we've still got some slow real slow reflow-on-keypress in there (in the 100-500ms range).

Component: Layout → Layout: Flexbox

Hmm, the slow reflow comes from ScrollSelectionIntoViewEvent... Is there any reason that has to run early in the refresh driver tick rather than later (where it wouldn't need to reflow again?)

Not sure if that'd win us anything though.

Hi Catalin, can you confirm that only Nightly is affected but not beta?

Flags: needinfo?(catalin.sasca)

Hi Jens, I tried reproducing the issue but had no success both on Firefox 74.0b2 and Nightly 75.0a1 (2020-02-12) with all the steps from Comment 0, Comment 3 and Comment 15. It seems to be fixed.

Flags: needinfo?(catalin.sasca)

Nightly 75.0a1(20200212205745) and Firefox 74.0b2 is still laggy than Firefox73.0 on Windows10.

Attached video 75a1.vs.74b2.vs.73.mp4

STR
Disable spellchecker if any
Hold down "a" key

Screencast:
0:00-0:11 75.0a1
0:11-0:24 74.0b4
0:24- 73.0

Original case was an increasing laggyness while using the input box, which I assume is now fixed as of comment 27.
So what Alice sees here is probably a more general (but less extreme) regression?

(In reply to Jens Stutte [:jstutte] from comment #30)

Original case was an increasing laggyness while using the input box, which I assume is now fixed as of comment 27.
So what Alice sees here is probably a more general (but less extreme) regression?

Yes, it is laggy but not extreme(need patience:)

I don't know if this is another regression because I can't find another good builds after comment#3 bad build.

Thanks for your help, Alice, this helps hopefully to assess the severity.

We are going to keep investigating flexbox perf issues, but the likelihood that this will see improvement in 75 is pretty low. I'm going to update to reflect reality.

Tested on Nightly76.0a1(20200326213652), text input is much better than before.
I will mark this as WORKSFORME.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WORKSFORME
Has Regression Range: --- → yes
Performance Impact: --- → P1
Whiteboard: [qf:p1:responsiveness]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: