D17243: Only cal updateView() in visibleRange() when endPos() is invalid.

Kåre Särs noreply at phabricator.kde.org
Thu Nov 29 20:26:02 GMT 2018


sars created this revision.
sars added reviewers: cullmann, Kate, dhaumann.
sars added a project: Kate.
Herald added subscribers: kde-frameworks-devel, kwrite-devel.
Herald added a project: Frameworks.
sars requested review of this revision.

REVISION SUMMARY
  visibleRange() has a side-effect that the visible range is updated every time the function is called. This is a big problem in createHighlights().
  
  I created a dummy XML file that has an almost 4096 characters long line. I then used the search plugin to replace >< with >\n< to split the line.
  
  Without the patch on my computer it took 1 min 30s to split the lines.
  With this patch the time went down to 48s.
  
  The time is still bad, but much better ;)
  
  I wonder if the comment on line 3318 "//ensure that the view is up-to-date, otherwise 'endPos()' might fail!" warns about some corner case that I have not encountered...

REPOSITORY
  R39 KTextEditor

REVISION DETAIL
  https://phabricator.kde.org/D17243

AFFECTED FILES
  src/view/kateview.cpp

To: sars, cullmann, #kate, dhaumann
Cc: kwrite-devel, kde-frameworks-devel, hase, michaelh, ngraham, bruns, demsking, cullmann, sars, dhaumann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwrite-devel/attachments/20181129/fbf87565/attachment.html>


More information about the KWrite-Devel mailing list