[Insight-users] Guidelines for speed and memory footprint optimization

Sergio Vera sergio.vera at alma3d.com
Wed Nov 10 03:33:51 EST 2010


A
We call ReleaseDataFlagOn() on all the filters except the last one and the
ones that have more than a downstream filter to release intermediate images
once they are not useful anymore. But if you are activating streaming on the
writer sink. maybe this will not improve your memory consumption too much.

Also I may ask if you use streaming when there is no writer at the end? and
if yes, how you enable streaming in this case?

Thanks

Sergio

On Wed, Nov 10, 2010 at 8:54 AM, Jerome Maudlin <jerome.maudlin at gmail.com>wrote:

> Dear all,
>
> I am implementing a processing chain which has strong constraints in terms
> of computational time and memory footprint. We are also forced to use one
> single thread for whole pipeline.
>
> I have identified several ways for optimizing my code, but I was wondering
> if there are other things I could do. Here is what I have found until now:
>
> 1. For multi-channel images, the use of scalar images with FixedArray
> pixels gives a 1.5 speedup factor with respect to the use of VectorImage
> with scalar pixel types (I know the number of bands at compilation time).
>
> 2. Even though I need to work with real types for the computations
> (physical magnitudes between 0 and 1), I found that writing intermediate
> results to files using real types is much slower than multiplying the values
> by a large constant and writing the result to disk using integer types.
>
> I was also wondering if there is a smart way to choose the number of
> streaming divisions for the writer in order to ensure that the memory
> footprint of my program does not goes beyond a given size (other than try
> and error).
>
> Thank you very much for your help.
>
> JM
>
> PS: If there are general guidelines for this kind of optimization, maybe
> there should be a chapter in the software guide or a wiki page for this
> topic?
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>


-- 
Sergio Vera

 Alma IT Systems
 C/ Vilana, 4B, 4º 1ª
 08022 Barcelona
 T. (+34) 932 380 592
 www.alma3d.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20101110/6328f91c/attachment.htm>


More information about the Insight-users mailing list