[Gdal-dev] [RFC] RasterIO speedup patch

Tim Beckmann tbeckman at usgs.gov
Tue Feb 18 09:56:06 EST 2003


No problem on the delay.  I understand having a large mail queue (I've 
never seen so much traffic on the gdal list as there has been lately ;). I 
haven't had time since I sent the email to work on the GDALCopyWords 
anyway.  That's why I didn't poke you sooner.

I didn't receive an email that my patch had been applied.  I assumed the 
submitter would automatically be notified.  Not a big deal - now I know 
;).  Thanks to you and Andrey for applying it.

I'll make sure my follow-on patch(es) test for pointer alignment (will be 
a little bit yet before I find the time to finish the patches).

Tim Beckmann               tbeckman at usgs.gov
Software Project Lead
EROS Data Center, Sioux Falls, SD 57198
605-594-2521    Phone
605-594-6940    Fax

Frank Warmerdam <warmerdam at pobox.com>
Sent by: gdal-dev-admin at remotesensing.org
02/18/2003 08:46 AM
Please respond to gdal-dev

        To:     gdal-dev at remotesensing.org
        Subject:        Re: [Gdal-dev] [RFC] RasterIO speedup patch

Tim Beckmann wrote:
> Resend... Frank, you didn't reply to this email and it has a question in 

> that I need an answer to...


Sorry about that.  Approximately 1400 "in queue" email message fell into 
HD black hole a week and a half ago.

> Okay, I put it in bugzilla.  It is #281.

As noted in Bugzilla Andrey has applied your patch.

> I still need to clean up the other changes a bit before I submit them. 
> question for you.  When GDALCopyWords does data type conversions, it 
> memcpy for copying out a single data element at a time.  The only reason 
> 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 
> someone could end up with incorrectly aligned buffers when calling 
> GDALCopyWords directly (but for efficiency maybe it should just error 
> in that case and the driver should be fixed).

GDALCopyWords() is sometimes used to copy data out of buffers read from 
that are not word aligned, so this is an issue.  I think that if you want 
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 

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
and watch the world go round - Rush    | Geospatial Programmer for Rent

Gdal-dev mailing list
Gdal-dev at remotesensing.org

More information about the Gdal-dev mailing list