ソースを参照

Improve performance disabling "deletion" observation

Now the VTK pointer is set to zero independently of the DeleteEvent
observation, the observation is only needed to explicitly
disconnect the Qt slots. Since keeping the connected slots around doesn't
impact performance, this commit disabled the "deletion" observation.

If needed, a future additional improvement would be the pruning of
connection there are associated with deleted VTK object. This could be
done in the same loop taking care of shadow connection.

Results of ctkVTKObjectTest1:

[ObserveDeletion = true]
148: Create  10000  connections...
148:   elapsed time:  3.06955 seconds
148: Remove  10000  connections...
148:   elapsed time:  3.44588 seconds

[ObserveDeletion = false]
148: Create  10000  connections...
148:   elapsed time:  0.775543 seconds
148: Remove  10000  connections...
148:   elapsed time:  0.760212 seconds
Jean-Christophe Fillion-Robin 11 年 前
コミット
1d9648c417
共有1 個のファイルを変更した1 個の追加2 個の削除を含む
  1. 1 2
      Libs/Visualization/VTK/Core/ctkVTKObjectEventsObserver.cpp

+ 1 - 2
Libs/Visualization/VTK/Core/ctkVTKObjectEventsObserver.cpp

@@ -139,8 +139,7 @@ ctkVTKObjectEventsObserverPrivate::ctkVTKObjectEventsObserverPrivate(ctkVTKObjec
 {
   this->StrictTypeCheck = false;
   this->AllBlocked = false;
-  // ObserveDeletion == false  hasn't been that well tested...
-  this->ObserveDeletion = true;
+  this->ObserveDeletion = false;
 }
 
 //-----------------------------------------------------------------------------