Moving the cursor in a long post in Firefox Linux has significant latency


(Ralf Jung) #1

When I am writing long posts (say, larger than a screen), editing the post becomes increasingly hard because moving around the cursor has some significant latency: When I just hit the left/right arrow keys with 2-3 Hz, I can see that the cursor position on the screen often freezes for a second or two. Similar for typing. Actually, typing is fine, just navigating the cursor around with the arrow keys is a problem. That’s quite bad for interactive text editing.

I can reproduce this easily by just writing a long post. E.g., I just copied the text from another Discourse instance to here, and the issue occurs on this instance as well. Short posts are fine though.

I did a brief run with the debugger tools, but they claim the framerate stays above 55fps all the time – so the problem doesn’t seem to be draw speed? Not sure what is going on, I do not have any web development experience.

This is using Firefox 62.0b15 on Linux.


(Joffrey Jaffeux) #2

AFAIK 62 is not stable version, can you reproduce this on 61 ?


(Jeff Atwood) #3

We do not support beta browsers. Try on a stable browser.


(Ralf Jung) #4

Fair enough.

I verified that the same issue occurs with Firefox 61 (stable).


(Rafael dos Santos Silva) #5

What is an example of a laggy post?

Does it contains a lot of special content, like: emoji, onebox, local-date, etc ?


(Ralf Jung) #6

An example would be Stacked Borrows: An Aliasing Model For Rust - Unsafe Code Guidelines - Rust Internals

Another one would be Blog post: never patterns, exhaustive matching, and uninhabited types - Rust Internals

As I just noticed, cursor movement is only laggy towards the end of these posts. IOW, it seems to be more a function of the cursor position (how far away it is from the beginning) than post size. Moving the cursor around in the beginning of the post is fine even for long posts.

Also, I am not experiencing this in other places where I can write long posts, e.g. on GitHub – which is why I reported this here, not in the Firefox bugtracker.


#7

For what it is worth, I have had no problems like this but I am not using Firefox on Linux:
Firefox 61.0.2 64-bit on Windows 10 64-bit


(John Sweeney) #8

I can reproduce this. I copy & pasted the first example post, then started adding garbage text at the end.

What I found in this testing is that it isn’t laggy so much as sometimes non-responsive. If you’re actively typing text and try moving the mouse, it will either be delayed in reacting or won’t react at all. If you wait a couple of seconds then try, it will consistently respond promptly as you’d expect. Hope this helps!

Running Firefox v61.0.1 x64 on Ubuntu.


(Sam Saffron) #9

@tgxworld can this be preview sync? Can you repro? Do you have a slowish computer around or perhaps a long post.


(John Sweeney) #11

Here’s my system info in case it helps reproduce the issue;

  • Ubuntu 18.04.1 LTS x64
  • i7 6500U @ 3.1 GHz
  • 8GB of RAM
  • Intel HD 520

Both Firefox and Discord were open at the time - so approximately 50% of the RAM was available.


(Alan Tan) #12

@RalfJung @khenmu I can’t seem to reproduce this on Firefox 61 or Chrome 68. Is there something I’m missing in my attempt?


(Jeff Atwood) #13

Are you on Linux? It seems to be specific to Firefox / Linux?

Also those of you testing in Firefox, are you testing in safe mode without any plugins active?


#14

I tested quite a lot on Windows 10:

Firefox with or without the default set plugins/add-ons.

Created and edited four long topics:

  • two of the examples that caused problems
  • one with lots of random text
  • one with lots of quotes and hyperlinks

Also ran with and without Process Lasso to see if I could pickup any unusual system usage in other processes and Firefox itself.


(John Sweeney) #15

Hi there Alan, thanks so much for looking into this.

A couple of quick caveats: I’m not the OP, so it’s possible when attempting to reproduce the issue I stumbled upon something subtly different - and also I’m not a developer; apologies if I use any terms incorrectly.

I’ve looked at your video and realized that my testing hadn’t been accurate. As I said in my previous post, it was the mouse I’d been moving, not the blinking cursor. If you try type a bunch of letters, then move the mouse you might run into the issue I did - we’d need @RalfJung to confirm whether it’s their issue or not.

I’ve known some developers who disliked anecdotal and unscientific 'what it feels like’s, but if you’re interested, the way I would put it is it’s as if user input is entirely single-threaded, and when the browser hasn’t finished with the text you’ve typed, attempts to move the mouse immediately afterwards aren’t successful. Think of ringing a phone and getting an engaged tone.

Edit: I’m very sorry - having read the OP again, I don’t believe I can reproduce this.


(John Sweeney) #16

I’ve done this now and the issue persists.

When actively typing text attempts to move the mouse are unsuccessful. After typing a substantial volume of text, attempts to move the mouse immediately afterwards are similarly unsuccessful.

(I assume you mean Firefox plugins, not Discourse plugins? I’ve been testing on meta.discourse.org.)

Edit: I’m very sorry - having read the OP again, I don’t believe I can reproduce this.


(Rafael dos Santos Silva) #17

I can’t repro this on the current Firefox on Linux.

@RalfJung do you use some extension that affects text areas? Like a fancy auto-correct or something like that?


(Jeff Atwood) #18

Sigh. This is almost certainly a rogue Firefox plugin, and we’ve collectively wasted hours on it now.

Do you understand why I distrust third party plugins so much now @erlend_sh? Any business built on a mountain of inconsistently implemented third party plugins of wildly varying quality is bad. Bad for the business, bad for the customers, bad for everyone.

I wrote a blog entry about this a decade ago and if anything my experiences since then have reinforced this position for me. Substantively.

https://blog.codinghorror.com/the-dark-side-of-extensions/


(Ralf Jung) #19

When I reproduced the issue on stable Firefox, I used a completely fresh profile with no add-ons installed.

I can try safe mode as well if you want, but a fresh profile should be about as baseline as it gets.


(Jeff Atwood) #20

That’s odd, none of us can reproduce it, so it seems specific to your computer somehow.