Page MenuHomePhabricator

The usage of the itkNewMacro may lead to performance bottlenecks
Closed, ResolvedPublic

Description

In almost all MITK classes which derive from itk::LightObject, the ITK itkNewMacro is used to generate a static New() method. This method asks all registered ITK object factories if they can create an object of the given type.

Many calls to such New() methods with a high number of registered object factories result in many cpu cycles spent asking object factories. Because the object factory mechanism is not used at all in MITK (at least for injecting customized types into the object creation system), this overhead is not justified and the alternate itkFactorylessNewMacro macro should be used instead.

Event Timeline

User zelzer has pushed new remote branch:

bug-17339-factoryless-new

[51a9ba]: Merge branch 'bug-17339-factoryless-new'

Merged commits:

2014-02-26 01:06:12 Sascha Zelzer [277cb9]
Fixed static initialization order problem.


2014-02-26 00:33:51 Sascha Zelzer [702821]
Replaced all itkNewMacro occurrences with itkFactorylessNewMacro.