[Insight-users] Debug mode is slow

Luis Ibanez luis . ibanez at kitware . com
Mon, 16 Jun 2003 11:49:33 -0400


Hi Tim,

All ITK filters will be much quicker in Release mode.

When you compile for Debug mode, the code that is
intended to be inlined is just compiled as regular
functions. Debug mode, doesn't take advantage of
all what templates are supposed to contribute in
run-time performance.

Filters like the MedianImageFilter in a 5x5x5
neighborhood will run 10 to 15 times faster when
compiled for Release.

So, yeap: Please rebuild your application for Release,
that should make a huge difference.

Note that you must recompile ITK itself for release,
as well as any other third party library you may be
using in your applications. (e.g. VTK, FLTK...).
Mixing compilation modes will result in link problems
and run-time instability.

If after compiling for release you still find the
execution time to be too long, there are a couple
of things that can be done for improving performance.
For example doing multiresolution in the level set,
and improving the initializatoin.

Please let us know what you find


Regards,


    Luis


-----------------
Tim Rudge wrote:
> Hi,
> 
> Im using itkShapeDetectionLevelSetFilter and it seems to be v. slow in 
> debug mode (to the point where im having to resample from 500^3 to 50^3 
> to get reasonable comp. times of 1-2 mins for the whole pipeline). Will 
> this be much quicker in release mode or am i doing s/thing wrong? This 
> is on a dual 600MHz 2Gb winXP m/c.
> 
> Tim
> 
> Tim Rudge
> ---------
> Cellular Development Lab
> Dept. Plant Sciences
> Cambridge University
> _______________________________________________
> Insight-users mailing list
> Insight-users at www . itk . org
> http://www . itk . org/mailman/listinfo/insight-users
>