Re: [gdal-dev] GDALRasterBand::RasterIO c++ vs BandReadAsArray python performance (Gareth Jones)

2016-05-12 Thread Gareth James Jones [gjj12]
Hi Sean, I initialise datatmp using CPLMalloc in the C++ T* dataTmp = (T*)CPLMalloc(sizeof(T) *(this->dspRastXSize * this->dspRastYSize)); this is then freed using CPLFree once finished with. I do re-malloc it for each band we want to read in a raster so that does add some slowdown that cou

Re: [gdal-dev] GDALRasterBand::RasterIO c++ vs BandReadAsArray python performance

2016-05-11 Thread Sean Gillies
Hi Gareth, How are you initializing your dataTmp array? In my Rasterio project, I've found that numpy.empty() is the fastest array allocator and use it whenever possible. I also use the GDAL C API and Cython (in case you're interested: https://github.com/mapbox/rasterio/blob/c80b568903ef7b902ce625

[gdal-dev] GDALRasterBand::RasterIO c++ vs BandReadAsArray python performance

2016-05-11 Thread Gareth James Jones [gjj12]
I'm currently writing optimisations for a raster viewer program which uses gdal as it's base. It's currently written purely in python, and has some major speed issues which cause problems when we are reading many files at a time. After making some optimisations in the python, and getting quite a