#776819 gedit slow to open a text file with one long line; search functionality maxes out CPU.

Package:
gedit
Source:
gedit
Description:
popular text editor for the GNOME desktop environment
Submitter:
Wayne Hartell
Date:
2015-02-02 05:09:06 UTC
Severity:
normal
#776819#5
Date:
2015-02-02 05:05:53 UTC
From:
To:
Dear Maintainer,

Using gedit to open a text file with one long line (or multiple long lines) is
very slow and searching such a file is unusable. For example, trying to open a
1.1MB text file with one long line takes over 2.5 minutes for me. When I
attempt to search said file gedit locks up the moment I type the first letter
in the search string. This is confirmed with System Monitor showing a maxed out
CPU for gedit.

I have tried turning off all plug-ins in gedit (except for "File Browser
Panel") but it made no difference to the performance.

I would expect that gedit would open such a file in a matter of seconds (if not
quicker) and that search functionality would execute within seconds also and
not max out the CPU.

I found a work-around for text files with long lines and that is to run the
"fold" command to convert the text file to a certain column width. i.e., it
breaks the text file into small lines.
fold -sw 80 in.txt > out.txt

When using this work around, gedit opens the resultant file and searches it
with the performance characteristics I was originally expecting.

I will attach a sample text file to this report.

Thanks.