[Gdal-dev] [RFC] RasterIO speedup patch
dron at ak4719.spb.edu
Tue Feb 18 10:23:03 EST 2003
I've deleted this patch because of problems it produces. I shall return
back to this issue shortly and ftry to fix the crash. This improvement
was not forgotten.
On Tue, Feb 18, 2003 at 09:46:33AM -0500, Frank Warmerdam wrote:
> As noted in Bugzilla Andrey has applied your patch.
> >I still need to clean up the other changes a bit before I submit them. One
> >question for you. When GDALCopyWords does data type conversions, it uses
> >memcpy for copying out a single data element at a time. The only reason I
> >can think of why this would be done is that you're worried about being
> >given data buffers that aren't properly aligned in memory for platforms
> >that have such limitations. Is this correct? The next set of changes
> >assumes memory alignment is correct. I can either try using memcpy and
> >see if it impacts speed in my changes, or I can make it one more special
> >case that the changes I've done are only used when memory alignment
> >constraints are met. Actually, I can't think of a case where memory
> >wouldn't be correctly aligned when going through RasterIO. But I suppose
> >someone could end up with incorrectly aligned buffers when calling
> >GDALCopyWords directly (but for efficiency maybe it should just error out
> >in that case and the driver should be fixed).
> GDALCopyWords() is sometimes used to copy data out of buffers read from disk
> that are not word aligned, so this is an issue. I think that if you want to
> copy by word in some cases then GDALCopyWords() should verify that the
> pointer is word aligned.
> Don't hesitate to poke me when I don't respond in a day or two to a
Andrey V. Kiselev
Home phone: +7 812 5274898 ICQ# 26871517
More information about the Gdal-dev