浏览代码

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->StrictTypeCheck = false;
   this->AllBlocked = false;
   this->AllBlocked = false;
-  // ObserveDeletion == false  hasn't been that well tested...
-  this->ObserveDeletion = true;
+  this->ObserveDeletion = false;
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------