Dear all,<div><br></div><div>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.</div><div>
<br></div><div>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:</div><div><br></div><div>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).</div>
<div><br></div><div>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.</div>
<div><br></div><div><div>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).</div>
<div><br></div><div>Thank you very much for your help.</div><div><br></div><div>JM</div></div><div><br></div><div>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?</div>