You are here: PSPad forum > Bug report / Hlášení chyb > Re: Bug? Lengthy -> unusable search and replace on large files; lagging processing of extremely long lines

Re: Bug? Lengthy -> unusable search and replace on large files; lagging processing of extremely long lines

#1 Bug? Lengthy -> unusable search and replace on large files; lagging processing of extremely long lines

Posted by: lhalda | Date: 2014-10-05 20:59 | IP: IP Logged

TL;DR When editing files with long lines, PSPad is lagging and replace using regexps is almost impossible, totally hanging the editor. The phreplace extension works fine though.

Hello, as this is my first post here, I'd love to thank for the PSPad development. PSPad is my advanced text editor of choice, I like its relatively easy to use and yet powerful interface.

And to the topic now - recently I tried to create a relatively huge textual database - dictionary (list) of Scrabble-acceptable words to be viewed in GoldenDict. I thought that would be easy task, provided lists of words already exist and the .dsl format I chose is relatively easy to use, with simple syntax.

When working on it, I was forced to download Notepad++ for some replacement tasks, because PSPad would not process large files (over 2MB in one line in the example below) smoothly and is SO slow when processing long lines, while Notepad++ processes such tasks fairly fast. (N++ has other issues though, for instance it would regularly screw up EOLs while replacing. All in all, this whole work was excruciating pain.) For example, while working on a partially processed SOWPODS file [2.6 MB], where I wanted to replace all the ; characters by new lines and then add a blank line with tab after every 32 lines, Notepad++ does it as follows (Pentium Core 2 Duo @ 2GHz, it utilized full power of 1 core):
1) Find all instances of;, replace it with\r\n: 267769 instances, 94s
2) Find all instances of((\w{2,100}\r\n){32}), replace it with$1\t\r\n: 8363 instances, 7s
(Finished file [2.9 MB]) (Whole work)

While testing this partial file, try to edit some text in the middle of the line to experience the lagging behavior of PSPad when working with such file.

PSPad hung on first task for over 30 minutes before I killed it (when file was significantly shortened, it worked fine though, it just took too long to process the request on whole file). Second task couldn't be done at all - I couldn't find how to feed it with$1\t\nfor replacement, even though the string could be found using((\w{2,100}\n){32}).

Using phreplace extension it's blazing fast (under three seconds for both tasks) and very easy to do though. Shame I found it only after I finished everything in Notepad++ smiling smiley

I suggest either rewriting PSPads search & replace engine not to hang the PSPad process and be as efficient as phreplace (I know, way easier said than done), or at least tweak it a bit so the user can escape the lengthy process once it has started, maybe with suggestion to download the phreplace extension smiling smiley I'd like to see something like a progress bar emerge when it takes over say 5s to be processed, with an option to cancel it and get back to the file I'm working on.

Edited 2 time(s). Last edit at 2014-10-05 21:03 by lhalda.

Options: Reply | Quote | Up ^


#2 Re: Bug? Lengthy -> unusable search and replace on large files; lagging processing of extremely long lines

Posted by: pspad | Date: 2014-10-06 04:54 | IP: IP Logged

Hello

You are right, Search/replace in PSPad is really slow in some cases, especially in your case when whole text contains one line only.
I put it as my priority, but it will take some time to replace whole search/replace engine.
I need to change used concept, throw away search engine from used component and write my own from the begin.

Options: Reply | Quote | Up ^






Editor PSPad - freeware editor, © 2001 - 2021 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR