[Gdal-dev] performance problem with several DEM reading/updating at the same time

LALLAURET Fabrice - <SSII> fabrice.lallauret at thales-tts.com
Fri May 20 13:36:40 EDT 2005


Hello,
I'm playing with gdal and I don't understand some performance problem I 
have:
I'm reading several geotiff dems pixel by pixel at the same time (I 
know, this is not optimal but for my application, it's simplifying the job).
My code is like this :

    for (int i = 0; i < nbx1 ; i+=step)
    {
        for (int j = 0; j < nby1 ; j+=step)
        {
            z1 = z2 = 0.0;
            eErr = band1->RasterIO( GF_Read, i , j , 1 ,1 , &z1 ,1 ,  1 
, GDT_Float32, 0,0);
            if (eErr != CE_None)
                printf("Problem reading band1  %d %d\n",i,j);
            eErr = band2->RasterIO( GF_Read, i , j , 1 ,1 , &z2 ,1 ,  1 
, GDT_Float32, 0,0);
            if (eErr != CE_None)
                printf("Problem reading band2  %d %d\n",i,j);
        }
    }
When I only read a single dem, the test program takes 0.95 s to run. If 
I read a second dem at the same time (as above), the program takes 50 s. 
Why this difference of performance ? (With a writting process performing 
the same test, the program reach 12min !!)

Thanks

-- 
     .--.    Fabrice LALLAURET - STV Team
    |o_o |   Tel: (33) (01 34) 22 84 33
    |:_/ |   Thales Training & Simulation
   //   \ \  1, rue du General de Gaulle
  (|     | ) Z.I. les beaux soleils
 /'\_   _/`\ Osny. B.P. 226
 \___)=(___/ 95523 Cergy-Pontoise Cedex
 E-mail: fabrice.lallauret at thales-tts.com
 My personnal (french) Websites: http://www.xbee.net
 and http://www.french-comics-zone.fr.st





More information about the Gdal-dev mailing list