[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwrite-devel
Subject:    Re: KDE/kdelibs/kate/view
From:       Christoph Cullmann <cullmann () absint ! de>
Date:       2010-12-15 6:06:34
Message-ID: 201012150706.34490.cullmann () absint ! de
[Download RAW message or body]

On Wednesday, December 15, 2010 12:17:00 am Dominik Haumann wrote:
> On Tuesday, 14. December 2010, Milian Wolff wrote:
> > Pascal Létourneau, 14.12.2010:
> > > SVN commit 1206542 by pletourn:
> > > 
> > > Optimization:
> > > Clear selection range (it's moving range) before removing text
> > > 
> > > BUG:259879
> > > 
> > >  M  +4 -1      kateview.cpp
> > > 
> > > --- trunk/KDE/kdelibs/kate/view/kateview.cpp #1206541:1206542
> > > @@ -1783,11 +1783,14 @@
> > > 
> > >    m_doc->editStart ();
> > > 
> > > -  m_doc->removeText (m_selection, blockSelect);
> > > +  // Optimization: clear selection before removing text
> > > +  KTextEditor::Range selection = m_selection;
> > > 
> > >    // don't redraw the cleared selection - that's done in editEnd().
> > >    clearSelection(false);
> > > 
> > > +  m_doc->removeText(selection, blockSelect);
> > > +
> > > 
> > >    m_doc->editEnd ();
> > >    
> > >    return true;
> > 
> > This would probably also be "fixed" by making the revision history
> > slimmer for this case, i.e. don't store one item per removed line but
> > just one item that removes all in one go.
> 
> And maybe this should even be covered by a unit test? If the performance
> penalty is that big, it's probably just a matter of time until someone
> comes and changes the code accidently again. On the other hand, we'll
> never have unit tests for everything, so maybe this is just a wrong idea
> ;)
Actually the revision history has nothing to do with this performance impact, 
only that the range must be touched the whole time for each small change, 
which is not related how to store the changes for the revision history which 
is btw. not used in kate part itself at all ;)

Greetings
Christoph

-- 
-------------------------------------- Christoph Cullmann ---------
AbsInt Angewandte Informatik GmbH      Email: cullmann@AbsInt.com
Science Park 1                         Tel:   +49-681-38360-22
66123 Saarbrücken                      Fax:   +49-681-38360-20
GERMANY                                WWW:   http://www.AbsInt.com
--------------------------------------------------------------------
Geschäftsführung: Dr.-Ing. Christian Ferdinand
Eingetragen im Handelsregister des Amtsgerichts Saarbrücken, HRB 11234
_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic