[Insight-developers] Impact of GCC 3.4 changes

Miller, James V (Research) millerjv at crd.ge.com
Fri Mar 11 13:02:30 EST 2005


We have been getting a number or reports that ITK 2.0 is slower than ITK 1.8 and ITK 1.6.  Sometimes it can be as much 20X slower.  A few of the users have dug in and found that their particular performance issues are related to the modifications made to support GCC 3.4.  If you recall, GCC 3.4 has a stricter interpretation of the standard and requires that when a class references a protected member variable that is owned by a templated superclass, you need to reference said variable using this->m_Variable instead of referencing the variable using just m_Variable.
 
When the port to GCC 3.4 was done, we decided that some of these variables should not be protected members since that violates the ITK style guide.  These variables were moved into the private section and access methods were created.  If access methods already existed, the code was modified to use the access methods.  
 
For GCC 3.3 on cygwin, a performance penalty has resulted when using the access methods in place of a direct variable access.  Some of the access methods are virtual and would seem to be the cause of the issue.  However, making the methods nonvirtual suprisingly does not fix the performance issue (even if the methods are inline).  Transitioning back to the direct variable access fixes the problems.
 
I have modified ImageBase, Image, and FloodFilledImageFunctionConditionalConstIterator to address the reported issues.  However, we should revisit the files modified for gcc 3.4 to determine if other files should be "fixed".  I put  a list of all the files which were modified for gcc 3.4 on the bugtracker. This list was compiled assuming all cvs log messages for such fixed contained the text "gcc 3.4" in them. 
 
If we fix these issues we should put a common item in the log messages so that we can keep track of which files were affected.  Perhaps a common bug number.  I created a bug that can be used for this task (for ImageBase, Image, and FloodFilledImageFunctionConditionalConstIterator I used separate bug numbers but that will get tedious, so the following bug number can used for future performance issues related to the gcc 3.4 port).
 
Bug #1665 - ITK 2.0 performance issues related to GCC 3.4 port 
 
After we fix these, we should patch the 2.0 release
 
 

Jim Miller 
_____________________________________
Visualization & Computer Vision
GE Research
Bldg. KW, Room C218B
1 Research Circle, Schenectady NY 12309-1027

millerjv at research.ge.com

james.miller at research.ge.com
(518) 387-4005, Dial Comm: 8*833-4005, 
Cell: (518) 505-7065, Fax: (518) 387-6981 

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.itk.org/mailman/private/insight-developers/attachments/20050311/5e7990ed/attachment.htm


More information about the Insight-developers mailing list