Use of Python with GDAL. How to speed up ?

Julien Fiore julienfiore at gmail.com
Wed Mar 22 10:45:07 CET 2006


Thanks Caleb for the advice,

I profiled my code with the following lines:

    import profile, pstats

profile.runctx('openness(infile,outfile,R)',globals(),locals(),'profile.log')
    p = pstats.Stats('profile.log')
    p.sort_stats('time')
    p.print_stats(10)

The outputs tells me that the openness() function takes most of the
time. This is not very useful for me, as openness() contains most of my
code. How to know which instructions take most time in the openness
function ? Do I have to separate the code into smaller functions ?




More information about the Python-list mailing list