On 2/17/07, Peter K. Stys <[EMAIL PROTECTED]> wrote:
> On 2/17/07, Theodore H. Smith <[EMAIL PROTECTED]> wrote:
>
> >
> > I'll bet you that Apple's CoreEndian can byte-swap 100MB of data in 1
> > tick :)
> >
>
> I bet you're right because these fns are defined as inline asm code,
> see CFByteOrder.h
>
For curiosity, byte swapping using:
for (ushortCtr = 0; ushortCtr < limit; ushortCtr++)
{ srcPtr[ushortCtr] = CFSwapInt16(srcPtr[ushortCtr]);
}
(all variables declared as 'register').
takes about 4.2 ns per byte pair on a 2 GHz Intel Core 2 duo iMac, and
16 ns on a 2 GHz twin G5. Surprising performance difference IMHO.
P.
--
-------------------------------------------------------------------------------
Peter K. Stys, MD
Professor of Medicine(Neurology), Senior Scientist
Ottawa Health Research Institute, Div. of Neuroscience
Ottawa Hospital / University of Ottawa
Ontario, CANADA
tel: (613)761-5444
fax: (613)761-5330
http://www.ohri.ca/profiles/stys.asp
-------------------------------------------------------------------------------
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>