On Sep 13, 2011, at 2:10 PM, Jon Sigman wrote:

> So, I'm stunned that this would be so much faster than using individual 
> fread() calls for each element.

I'm not. fread has a lot of overhead relative to reading 8 bytes. If your data 
structure really is just a big non-sparse n-dimension array of floating point 
numbers, you probably should always have been reading (& writing) it in a 
single call.

Note that your disk is not really providing 1.25GB/sec reads. What was probably 
happening is that the file contents were in system cache because of your prior 
reads. (Assuming that with the mmap code you were actually reading all the 
data...) Your first time after a reboot will probably still take 5-10 seconds 
at least, but that doesn't seem like it should be any problem for you.

-- 
Scott Ribe
scott_r...@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice




_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please 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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to