After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 748704 - Quadratic behaviour when pasting very long lines
Quadratic behaviour when pasting very long lines
Status: RESOLVED NOTGNOME
Product: gnome-terminal
Classification: Core
Component: general
3.14.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME Terminal Maintainers
GNOME Terminal Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-04-30 13:11 UTC by Ole Laursen
Modified: 2015-05-27 09:53 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ole Laursen 2015-04-30 13:11:05 UTC
Try making a really, really long line (say 20000 characters) somewhere, e.g. in an editor. Then paste it into a terminal window. The first many characters of output are inserted quickly, but after some time the terminal slows down. To me it looks like there's an O(n^2) algorithm somewhere in there. At some point it gets so slow that it's unusable.

In practice, I encounter this annoying problem when pasting long commands to a remote server.
Comment 1 Ole Laursen 2015-04-30 13:40:41 UTC
Maybe I should add that the 20k is just a suggestion that probably won't break your terminal completely. Try 200k instead to see what I mean by unusable.
Comment 2 Egmont Koblinger 2015-04-30 13:54:55 UTC
Are you sure it's a problem with the terminal emulator?  I find it more likely that it's an O(n^2) behavior in whichever app you're pasting to (e.g. a console editor, or the shell).

See also bug 539312.
Comment 3 Ole Laursen 2015-04-30 14:50:08 UTC
Hm, interesting. I'm seeing this with bash, psql (Postgres client), Python among others. But I suppose it could be something in GNU readline.

I just tried bash with --noediting and it's fast! Okay, sorry about that, I'll close the bug, thanks for the quick response.
Comment 4 Ole Laursen 2015-05-27 09:53:35 UTC
Just in case anyone else stumbles upon this: I reported the problem in readline, and it looks like there's a fix now

https://lists.gnu.org/archive/html/bug-readline/2015-05/msg00016.html

Hopefully, Chet will apply it.