Bug 48541 - KEdit class: search/replace very slow - redrawing after every change
Summary: KEdit class: search/replace very slow - redrawing after every change
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: SVN
Platform: openSUSE Linux
: HI wishlist
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-10-01 14:35 UTC by Ph. Marek
Modified: 2010-05-19 01:58 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Second backtrace, showing the signal plotter (4.25 KB, text/plain)
2009-02-12 09:08 UTC, Ph. Marek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ph. Marek 2002-10-01 14:35:31 UTC
Version:           1.4.3 (using KDE KDE 3.0.3)
Installed from:    SuSE RPMs
OS:          LinuxLinux

If I get an email with lots of indentation (> > > > ...) and do "compress spacing" (or similar - I'm using the german version) then all newlines are gone. (Which is not very aesthetic, btw.)
If I do now "replace '> ' by ''" then it takes up to some minutes to process a <10kB text!!! I think because every change is showed on the screen, and the automatic line breaks (which happen because there are no newlines in the text) has to reposition the text from start to end - and that takes some time.

This is a slow machine, PII 233MHz.

I believe that should be MUCH faster - so 1-2 seconds would be ok :-)


Thanks & regards,

Phil
Comment 1 Ingo Klöcker 2002-10-02 11:58:27 UTC
The "compress spacing" function acts according to the documentation, i. e. it   replaces all consecutive spaces _and_ single linebreaks with a single space.   This can be used to reformat existing paragraphs. One could argue that this   function should ignore quoted text. I submitted a corresponding wish.  The speed issue is more a wish than a bug.  
Comment 2 Ph. Marek 2004-05-11 13:12:54 UTC
The "main" problem, ie the redrawing on search/replace, is still there.

I have a much faster machine now, so it doesn't bother me as much, but search/replace on long emails still replaces one occurence, redraws the text (with line-breaking), replaces the next, ... So the text keeps blinking, and the cpu is heavily used.

This is not nice to watch.

Debian kmail 3.2.2-2.
Comment 3 FiNeX 2008-11-16 20:29:44 UTC
Is this bug still reproducibile? I'm using a quite powerful PC, so I cannot test :-)
Comment 4 Ph. Marek 2009-02-12 09:08:29 UTC
Created attachment 31239 [details]
Second backtrace, showing the signal plotter
Comment 5 Ph. Marek 2009-02-12 09:11:46 UTC
Comment on attachment 31239 [details]
Second backtrace, showing the signal plotter

Well, that got attached to the wrong bug. Sorry.
Comment 6 Ph. Marek 2009-02-24 14:41:36 UTC
With 4.2 it got much better; only the cursor position in the lower right corner and the scroll position gets redrawn.

But it's still not as fast as I'd hope; on a Athlon64 3800+ replacing all "e" (to "eeee") in /etc/services (565 lines, 18kB) with vim takes no noticable time, while if that text is in a new email and I use the search/replace dialog it takes about 15 seconds.
Comment 7 David Faure 2010-05-19 01:58:11 UTC
SVN commit 1128337 by dfaure:

Make search/replace much faster (when using 'replace all' i.e. no prompt-on-replace), by not moving the text cursor every time,
by wrapping everything into a single undo command (which is also a bugfix), and by still moving the cursor to the last
replacement.
BUG: 48541
FIXED IN: 4.5
(yep, 8 years later)


 M  +18 -3     ktextedit.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1128337