Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Moving Data in Memory



One trick I've heard of is to make the stride a non-power-of-two, for example try a power of two plus one. In other words, try adding a pad float between each row of the array. This allows you to use the whole cache, instead of reusing the same handful of entries in the cache over and over again.

(I learned this trick from another Blizzard employee named Rob. Props to him for coming up with it. I'm told it sped up Mac Doom 1 by a huge truckload, since its drawing engine writes pixels from top-to-bottom instead of left-to-right)



On Oct 15, 2004, at 1:23 PM, Gohara, David wrote:

Hi All,

  I was wondering is there an efficient way of moving data around that is separated by long strides?

  In particular I am dealing with a 2D array.  Once I perform the operation on the quick dimension (across in strides of 1) I then have to move down the array (in my case floats separated by a stride of 1024 (4096 bytes)).  At this point my app is bottlenecking shuffling the data to stride 1 before sending it to the next function for processing.

  Any tricks or suggestions or is this just one of those things you have to deal with?

  Similarly is it more efficient time wise to do the shuffling all at once (essentially rotating the array 90 degrees) or doing it by converting one column to a row, one at a time?  Or is there no difference?

  Thanks in advance!

Dave

David W. Gohara, Ph.D.
Harvard Medical School
http://www.scianafilms.com
617-432-1216 (p)
617-432-4360 (f)



_______________________________________________
Do not post admin requests to the list. They will be ignored.
PerfOptimization-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/perfoptimization-dev/email@hidden

This email sent to email@hidden
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
PerfOptimization-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/perfoptimization-dev/email@hidden

This email sent to email@hidden

References: 
 >Moving Data in Memory (From: "Gohara, David " <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.