Re: performance of encoding an array of structs
Re: performance of encoding an array of structs
- Subject: Re: performance of encoding an array of structs
- From: "stephen joseph butler" <email@hidden>
- Date: Tue, 12 Jun 2007 13:23:35 -0500
On 6/12/07, Dorian J <email@hidden> wrote:
Basically, when you encode an NSArray, it puts it into a plist. Since
you're using a c array, use an +[NSData dataWithBytesNoCopy:length:
] using _buffer and sizeof(MVTimedPoint) * _bufferSize as length and
store the resulting NSData. Then you can load the NSData straight
into your buffer when decoding. No converting to strings or plists,
just raw data. That should be a few orders of magnitude quicker.
Only do this if you don't care about clients running on an opposite
architecture. Your data won't load properly from Intel -> PPC, or PPC
-> Intel.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden