[Kst] extragear/graphics/kst/kst

George Staikos staikos at kde.org
Wed Jun 29 03:07:40 CEST 2005


On Monday 27 June 2005 18:22, Rick Chern wrote:
> SVN commit 429516 by rchern:
>
> Use _inputVectors for input vectors of vcurve instead of holding private
> pointers to them - remove reimplementation of loadInputs() and uses()
> - allows dependency checking to be more general
> - kstcurvedialog cannot seem to unlock within the same thread after locking
> when editing a curve
>
>  M  +6 -3      kstcurvedialog_i.cpp
>  M  +177 -148  kstvcurve.cpp
>  M  +4 -12     kstvcurve.h


This cleanup is great.  However I have one concern.  I actually had done some 
of this cleanup before but did not commit it because of performance issues.  
See for example:

 void KstVCurve::getEXMinusPoint(int i, double &x, double &y, double &ex) {
-  x = VX->interpolate(i, NS);
-  y = VY->interpolate(i, NS);
-  ex = EXMinus->interpolate(i, NS);
+  x = _inputVectors[COLOR_XVECTOR]->interpolate(i, NS);
+  y = _inputVectors[COLOR_YVECTOR]->interpolate(i, NS);
+  ex = _inputVectors[EXMINUSVECTOR]->interpolate(i, NS);
 }

  _inputVectors is a QMap which means we're doing string compares and a O(log 
n) search each time getFooPoint() is called.  This seems very expensive to 
me.  I think we need a better solution.  It's probably a good idea to use a 
dict instead of a map, but that's not the biggest issue.  I think we need a 
fast way to get at these pointers.  Maybe it needs a complete rethink.  Any 
ideas?

   Also did you test "Purge" since you made these input and dependency 
changes?

-- 
George Staikos
KDE Developer				http://www.kde.org/
Staikos Computing Services Inc.		http://www.staikos.net/


More information about the Kst mailing list