[gdal-dev] How to make my GDAL code faster?

Nicolas DEGARNE nicolas.degarne at gmail.com
Wed Apr 15 15:27:24 EDT 2009


Hy,

Thanks for your help Frank,it's allowed me to improve my program from 200s
to 14s that's show a great progress.

I didn't understand what is "rolling mean" could you please explain me?

An other question, is it possible to make multithread process?

thanks a lot for your help

Best regards,

Nicolas







Once you overhaul things to operate on substantial swaths of data, there
may also be some other opportunities for optimizing within your algorithm
(rolling means, for instance) but first solve the big IO overhead
bottleneck.





2009/4/15 Frank Warmerdam <warmerdam at pobox.com>

> Nicolas DEGARNE wrote:
>
>> I read on help and /gdal.h/ File Reference that it could exist faster way
>> so I have some ideas like :                   Merging the code to c++
>>             Using Read/Write block
>>             Use Tile/Block to accelerate the process
>>             Use the Warpprocess to calulate windows mean's faster
>>
>> I hope you understand my request and it was clear
>>
>>
>
> Nicolas,
>
> My advice would be to read an entire 5 line swath into a buffer, and
> then operate within that buffer.  Very small read/write operations
> are pretty expensive with GDAL and your approach of reading five pixels
> off one line as a single request is very very fine grained.
>
> Switching to C++ will not help noticably (just reducing one level of
> function call overhead, and a bit of extra checking the C API provides).
>
> At this point there is little value in going to exact TIFF tiles or using
> the block API.
>
> The Warp API is also going to be very high overhead to compute means.
>
> Once you overhaul things to operate on substantial swaths of data, there
> may also be some other opportunities for optimizing within your algorithm
> (rolling means, for instance) but first solve the big IO overhead
> bottleneck.
>
> Best regards,
> --
>
> ---------------------------------------+--------------------------------------
> I set the clouds in motion - turn up   | Frank Warmerdam,
> warmerdam at pobox.com
> light and sound - activate the windows | http://pobox.com/~warmerdam<http://pobox.com/%7Ewarmerdam>
> and watch the world go round - Rush    | Geospatial Programmer for Rent
>
>


-- 
Nicolas Degarne
76 rue de Nancy
94170 Le Perreux
06 84 93 80 94
nicolas.degarne at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20090415/13a887d0/attachment.html


More information about the gdal-dev mailing list