LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-01-2008, 10:52 AM   #1
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Unhappy Text editors acting very slow


My gedit was acting really slow while editing some HTML/PHP. Typing a key would take three to five seconds for the character to display and stuff. Other activities were also slow, such as highlighting text, or deleting highlighted text. The mouse would lag sometimes too. I figured it was some sort of gedit bug so I installed Bluefish. I was quite surprised to see the same behavior there.

My CPU (1.6Ghz Core Duo) scaling governor was set to "ondemand", so I changed it to "performance" to see if it would have any effect but no luck. I can clearly see (in top) a big CPU usage spike by either of these programs when the lag occurs. While these programs are acting-up, other programs such as Firefox behave normally.

Anyone seen anything like this? Any ideas what it could be?
 
Old 01-01-2008, 10:57 AM   #2
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
Bring up a top and see if anything is eating up CPU time.

Other then that, or editing ridiculously large files, I don't know why a text editor would be slow.
 
Old 01-01-2008, 11:03 AM   #3
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Original Poster
Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
I did. Just hitting the spacebar a few times while editing my HTML and stuff makes Bluefish use 80-100% for those three or four seconds of lag between me hitting the spacebar and me seeing the results in the editor. Grrr.
 
Old 01-01-2008, 12:32 PM   #4
nan0meter
Member
 
Registered: Aug 2007
Location: The Netherlands
Distribution: Fedora 7 x86_64
Posts: 119

Rep: Reputation: 15
Please post some more information about which linux distribution you are using, kernel version, GTK version etc.
 
Old 01-01-2008, 12:46 PM   #5
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Original Poster
Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by nan0meter View Post
Please post some more information about which linux distribution you are using, kernel version, GTK version etc.
It's Ubuntu 7.10. As for the kernel and GTK libs:
Code:
win32sux@candystore:~$ uname -a
Linux candystore 2.6.22-14-generic #1 SMP Tue Dec 18 08:02:57 UTC 2007 i686 GNU/Linux
win32sux@candystore:~$ dpkg -l libgtk* | grep ^i
ii  libgtk1.2                  1.2.10-18         The GIMP Toolkit set of widgets for X
ii  libgtk1.2-common           1.2.10-18         Common files for the GTK+ library
ii  libgtk2-perl               1:1.140-1build1   Perl interface to the 2.x series of the Gimp
ii  libgtk2.0-0                2.12.0-1ubuntu3   The GTK+ graphical user interface library
ii  libgtk2.0-bin              2.12.0-1ubuntu3   The programs for the GTK+ graphical user int
ii  libgtk2.0-cil              2.10.2-1ubuntu2   CLI binding for the GTK+ toolkit 2.10
ii  libgtk2.0-common           2.12.0-1ubuntu3   Common files for the GTK+ graphical user int
ii  libgtkhtml2-0              2.11.1-0ubuntu1   HTML rendering/editing library - runtime fil
ii  libgtkhtml2.0-cil          2.16.0-7ubuntu1   CLI binding for GtkHTML 3.8
ii  libgtkhtml3.14-19          3.16.1-0ubuntu1   HTML rendering/editing library - runtime fil
ii  libgtkhtml3.8-15           1:3.13.5-1        HTML rendering/editing library - runtime fil
ii  libgtkmm-2.4-1c2a          1:2.12.0-0ubuntu1 C++ wrappers for GTK+ 2.4 (shared libraries)
ii  libgtksourceview-common    1.8.5-1           common files for the GTK+ syntax highlightin
ii  libgtksourceview1.0-0      1.8.5-1           shared libraries for the GTK+ syntax highlig
ii  libgtksourceview2.0-0      2.0.1-0ubuntu1    shared libraries for the GTK+ syntax highlig
ii  libgtksourceview2.0-common 2.0.1-0ubuntu1    common files for the GTK+ syntax highlightin
ii  libgtkspell0               2.0.10-3build1    a spell-checking addon for GTK's TextView wi
win32sux@candystore:~$
EDIT: Note that the GTK 1.2 libs are only there for XMMS.

Last edited by win32sux; 01-01-2008 at 01:03 PM.
 
Old 01-02-2008, 02:18 AM   #6
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Original Poster
Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by jtshaw View Post
Other then that, or editing ridiculously large files, I don't know why a text editor would be slow.
It looks like you hit the nail on the head! Well, pretty close to the head at least - my files were all quite small and stuff. But it does seem like the problem is caused by large one-liner segments of code. Like, I would have parts that would go a long distance before having a line break. Stripped-down example:
Code:
<table><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr></table>
Once I cut lines like this into chewable bite-sized pieces like:
Code:
<table>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
The lag dissapeared. So I guess it is indeed a bug in whatever underlying text editing engine both gedit and Bluefish use. At least that's what it looks like to me. The good news is that it's easy to work-around, and plus you end-up with much more manageable markup!

Thanks for the support guys!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
RHCE on text editors Jzarecta Linux - Certification 8 07-18-2007 01:38 PM
text editors gballsch SUSE / openSUSE 4 09-16-2006 01:15 PM
what are the 'best' text editors (for C, html, js, etc) name_in_use450 Linux - General 4 08-31-2004 08:01 AM
GUI vs text editors R00ts Programming 9 07-20-2004 05:01 AM
Text editors Penguin Dropout Programming 6 06-16-2003 10:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration