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

List:       ktexteditor-devel
Subject:    Smart cursors, ranges and performance
From:       Hamish Rodda <rodda () kde ! org>
Date:       2005-06-25 2:04:22
Message-ID: 200506251204.22569.rodda () kde ! org
[Download RAW message or body]

Hi,

I'm looking at reworking the KateSuper* classes to perform better, as well as 
finally exposing them to the KTextEditor api.  Currently these classes work 
well at keeping their position within a document and emitting interesting 
signals.

Currently, each smart cursor and range is a QObject subclass.  Events such as 
movements trigger signals to be fired by the cursors, which are connected to 
the ranges to allow them to fire the relevant moved/changed signals etc.

I've decided for the sake of performance to do away with having these classes 
be QObject subclasses, at least internally.  I feel the choices are:

1) Create a separate cursor and range classes for the interface, which bind 
directly to the internal classes.
Advantages:
* the KTextEditor smartcursors could be QObjects if we wanted to keep the 
signals design
* if they were not to be QObjects, then we could make them simple classes that 
could be passed by value and reference rather than by pointer, and simply 
share the internal implementation

2) Share the class directly out through the interface.  
Advantages:
* faster?
Disadvantages:
* would have to use virtual methods and override them to get direct 
notifications, much like the *event methods in Qt's api.

I have thought a little about how the notifications would be used, and to me 
it seems that mostly what 3rd party developers would need from notifications 
is just when a text change happens, which is the smallest range that 
encompasses the whole change.

Does anyone have a feeling for which design (or have another alternative) 
would be better?  I think option 2 at the moment would be better for speed, 
and convenient enough.

Cheers,
Hamish.
_______________________________________________
Ktexteditor-devel mailing list
Ktexteditor-devel@kde.org
https://mail.kde.org/mailman/listinfo/ktexteditor-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

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