Slicer: 2145-support-for-installing-extension-from-file 6439e288

Author Committer Branch Timestamp Parent
jcfr jcfr 2145-support-for-installing-extension-from-file 2013-10-31 00:51:03 2145-support-for-installing-extension-from-file 54645f97
Changeset

ENH: Improved performance of qMRMLSceneModel

The indexFromNode method is called millions of times when there are a few hundred nodes and it browses through the whole model to find the requested node. Add a cache that stores the last search result and use it as a search hint.
New rows are always added to the cache, so the cache alone can be used to determine if a node is not yet in the model.

From: Andras Lasso <lasso@queensu.ca>

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22667 3bd1e089-480b-0410-8dfb-8563597acbee

mod - Libs/MRML/Widgets/qMRMLSceneModel.cxx Diff File
mod - Libs/MRML/Widgets/qMRMLSceneModel_p.h Diff File