[Insight-users] Release 2.0.0 slower than 1.6.0 and 1.8.1 - Cygwin1.5.13, GCC 3.3.3-3

Miller, James V (Research) millerjv at crd.ge.com
Fri Mar 4 12:51:26 EST 2005

Just finished my cygwin build

Visual Studio .NET 2003 (RelWithDebInfo) -  0.1 seconds
Cygwin GCC 3.3.1 (Release)               -  2.2 seconds

Certainly looks like there is a considerable efficiency factor wrt
the Cygwin GCC build.


-----Original Message-----
From: Miller, James V (Research) 
Sent: Friday, March 04, 2005 9:53 AM
To: 'Frederic Perez'; insight-users at itk.org
Subject: RE: [Insight-users] Release 2.0.0 slower than 1.6.0 and 1.8.1 -
Cygwin1.5.13, GCC 3.3.3-3


I just ran your code on a 512x512 CT image compile RelWithDebInfo using
Visual Studio .Net 2003 and the execution time was 0.1 seconds on my
2 year old laptop (in line with your reports on version 1.6 and 1.8).

I don't have a cygwin build on this machine to verify if it is a 
cywin/gcc issue.


-----Original Message-----
From: insight-users-bounces at itk.org
[mailto:insight-users-bounces at itk.org]On Behalf Of Frederic Perez
Sent: Friday, March 04, 2005 8:40 AM
To: insight-users at itk.org
Subject: [Insight-users] Release 2.0.0 slower than 1.6.0 and 1.8.1 -
Cygwin1.5.13, GCC 3.3.3-3

Hello Insight-users,

I updated my ITK version from 1.6.0 to 2.0.0 and, to my surprise, some of my 
applications, when recompiled for the ultimate version, run at a much slower 
pace. The affected applications use itk::ImageMomentsCalculator and 
itk::FloodFilledImageFunctionConditionalIterator. It is simply a problem 
of time---the results (generated images, for example) in all cases matched.
(Details using a simple test program are given below.)

I wonder if other Insight-users are experiencing the same behavior.

I have used Cygwin 1.5.13 and GCC 3.3.3-3 for all the tests, trying 
different CMAKE_BUILT_TYPEs but nothing rang a bell.
I even downloaded and built the intermediate ITK release 1.8.1, for which 
the tests were succesfull (timings similar to the ones using 1.6.0).

Any hint to solve this problem would be very much appreciated.

Thanks for your consideration,

Frederic Perez


A simple testing program follows:

#include "itkImageFileReader.h"
#include "itkImageMomentsCalculator.h"
#include "itkTimeProbe.h"

main( int argc, char ** argv )
  //  Read input image
  typedef short PixelType;
  typedef itk::Image< PixelType,  3 > ImageType;
  typedef itk::ImageFileReader< ImageType  > ReaderType;
  ReaderType::Pointer reader = ReaderType::New();
  reader->SetFileName( argv[1] ); // argv[1] holds the input filename

  //  Calculator stuff
  itk::TimeProbe clock;
  typedef itk::ImageMomentsCalculator< ImageType > CalculatorType;
  CalculatorType::Pointer calculator = CalculatorType::New();
  calculator->SetImage( reader->GetOutput() );
  std::cout << "Calculator starting to compute..." << std::endl;
  calculator->Compute(); // This was in a try/catch pair
  //  Give result and exit
  std::cout << "GetTotalMass = " << calculator->GetTotalMass() 
	    << " [ Time: " << clock.GetMeanTime() << " seconds ]" << std::endl;
  return 0;

Compiling and linking it to different ITK binaries, we obtain "foo.exe" files.
The result of their related executions for a certain input file are summarized

ITK v.  Built-type      Output (just the "Time:")
------  ----------      -------------------------
1.6.0   Release         [ Time: 0.672 seconds ]
1.8.1   Release         [ Time: 0.641 seconds ]
2.0.0   Release         [ Time: 33.203 seconds ]
2.0.0   RelWithDebInfo  [ Time: 36.406 seconds ]
2.0.0   RelMinSize      [ Time: 36.031 seconds ]
2.0.0   Debug           [ Time: 36.407 seconds ]

Surprisingly enough, the 2.0.0 debug related version lasts the same as the
optimization related versions!
Insight-users mailing list
Insight-users at itk.org

More information about the Insight-users mailing list