S&R: Disable highlighting while replacing
ClosedPublic

Authored by sars on Nov 12 2018, 3:43 PM.

Details

Summary

If we have files with long lines, Kate becomes slow.

One example where this is painful is with JSON and XML files that don't have newlines...

I'm using search&replace to wrap these files and sometimes relatively small files might take over a minute to be wrapped. So I tried to disable highlighting and spellchecking and got much faster results.

Test Plan

A file that took well over a minute to wrap is now almost instantaneous

Diff Detail

Repository
R40 Kate
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 5511
Build 5529: arc lint + arc unit
sars created this revision.Nov 12 2018, 3:43 PM
Restricted Application added a subscriber: kwrite-devel. · View Herald TranscriptNov 12 2018, 3:43 PM
sars requested review of this revision.Nov 12 2018, 3:43 PM
cullmann requested changes to this revision.Nov 27 2018, 5:54 PM
cullmann added a subscriber: cullmann.

Hmm, in principle that is only a hack, but I can understand why it helps :=)

Have you tried to use a

KTextEditor::Document::EditingTransaction transaction(document);

approach? Should have a similar effect, IMHO.

See

https://api.kde.org/frameworks/ktexteditor/html/classKTextEditor_1_1Document_1_1EditingTransaction.html

This revision now requires changes to proceed.Nov 27 2018, 5:54 PM
sars added a comment.Nov 29 2018, 3:53 AM

Thanks!

I tried it and it improves two things first the multiple replace is much faster and second you get the whole replace operation in one undo. I'll do an update when I have cleaned up the experiments a bit :)

sars updated this revision to Diff 46503.Nov 29 2018, 8:38 PM
sars edited the test plan for this revision. (Show Details)

Use EditingTransaction in stead of just disabling highlighting

sars retitled this revision from WIP S&R: Disable highlighting while replacing to S&R: Disable highlighting while replacing.Dec 6 2018, 7:04 AM
sars edited the summary of this revision. (Show Details)
sars edited the test plan for this revision. (Show Details)

I guess there are no objections to commit this :)

I have noticed it too, please to 18.12.

cullmann accepted this revision.Dec 6 2018, 8:27 AM

No, I like that solution, that is the way it was designed.

This revision is now accepted and ready to land.Dec 6 2018, 8:27 AM
This revision was automatically updated to reflect the committed changes.
sars added a comment.Dec 6 2018, 1:11 PM

Now I committed to master. Should I back-ported it to 18.12?