[Insight-users] Release 2.0.0 slower than 1.6.0 and 1.8.1 - Cygwin 1.5.13, GCC 3.3.3-3

Frederic Perez fredericpcx at gmail.com
Fri Mar 4 08:40:03 EST 2005


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"

int
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
  reader->Update();

  //  Calculator stuff
  itk::TimeProbe clock;
  clock.Start();
  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
  clock.Stop();
  
  //  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
below:

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!


More information about the Insight-users mailing list