Bug 402361 - Large search and replace operations cause Kate/KWrite to hang for long time
Summary: Large search and replace operations cause Kate/KWrite to hang for long time
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: search (show other bugs)
Version: 18.12.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-19 19:45 UTC by NiO
Modified: 2019-07-13 19:24 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description NiO 2018-12-19 19:45:52 UTC
SUMMARY
Large search and replace operations grind Kate/KWrite to a halt, sometimes taking several minutes to become responsive again. 

STEPS TO REPRODUCE
1. Copy and paste this text into Kate or KWrite https://pastebin.com/raw/a9NcnfBq
2. Replace " " with "," using plain text mode (10,403 replacements total)

OBSERVED RESULT
Application hangs for a very long time.  Upwards of 5+ minutes sometimes.  

EXPECTED RESULT
This should be a relatively quick process.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: KDE Neon 5.14
(available in About System)
KDE Plasma Version: 5.14.4
KDE Frameworks Version: 5.53.0
Qt Version: 5.11.2

ADDITIONAL INFORMATION
Problem is identical in Kate and KWrite and has existed for as long as I can remember.
Comment 1 Kåre Särs 2018-12-20 08:42:46 UTC
Hi,

You are probably referring to the built-in search.

This is a known issue for files with long lines in Kate/KWrite.

There is now ongoing work to split the replacing into chunks so that it will be possible to cancel the replace if it takes too long. 

A similar effort is also being done for the Search & Replace plugin. I'm actually testing the S&R change at the moment.


Hopefully this will be a bit improved for Kate 19.04
Comment 2 Christoph Feck 2018-12-20 18:08:59 UTC

*** This bug has been marked as a duplicate of bug 244424 ***
Comment 3 NiO 2018-12-20 23:15:24 UTC
(In reply to Kåre Särs from comment #1)
> Hi,
> 
> You are probably referring to the built-in search.
> 
> This is a known issue for files with long lines in Kate/KWrite.
> 
> There is now ongoing work to split the replacing into chunks so that it will
> be possible to cancel the replace if it takes too long. 
> 
> A similar effort is also being done for the Search & Replace plugin. I'm
> actually testing the S&R change at the moment.
> 
> 
> Hopefully this will be a bit improved for Kate 19.04

Great to hear, thank you.  

I guess Christoph's dupe confirms this has been an issue for quite a while. I did search beforehand but didn't notice any similar reports.  Apologies for the duplicate!
Comment 4 Christoph Feck 2019-01-17 04:58:40 UTC
Actually, reading the duplicate again, it only talks about the search operation. I am not sure if the replace operation (which needs to modify the text) can be executed in a separate thread.

Changing bug status and let Kate maintainers handle it.
Comment 5 Lothar 2019-01-18 14:21:07 UTC
> There is now ongoing work to split the replacing into chunks so that it 
> will be possible to cancel the replace if it takes too long. 

https://phabricator.kde.org/D17459
There are mentioned BUGs: 333517 244424
Comment 6 Christoph Cullmann 2019-07-13 19:24:11 UTC
The search/replace stuff got fixed!

The search stuff still is valid, see bug 244424