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: Mac OS X File IO Performance Issue?




On Jul 29, 2005, at 9:07 AM, Elliott Hughes wrote:

i don't have much experience of MS Windows, but compared to Linux, Mac OS' file I/O blows goats. it doesn't seem to be Java's fault: it's the OS itself.

one thing that's particularly crippling is Mac OS' apparent lack of interest in caching data (meta and user, from what i remember, but definitely user). Linux really goes all-out to cache as much as it can for as long as it can, and it really pays off on successive reads. Mac OS doesn't get much faster, no matter how many times you read something.

you can observe this with grep(1) or whatever. grep the GCC source tree, say, on Linux and Mac OS machines with lots of memory. gasp in awe at the Linux machine's second run, and maybe throw a party for it to give the Mac chance to catch up.

Mac OS X uses file caching pervasively and successfully. I have done tests with files on the order a few GB in size on my system with 4 GB of RAM when I was developing fibre channel drivers for Mac OS X. Secondary reading of the data happens from RAM not disk in my testing. In other words I have found the Mac OS X has what you think it lacks (far back as 10.1 in my testing if not earlier).


The following is an example of a 1000 MB file written and read using 1MB IO requests.

Create file (slow because of /dev/random generation overhead)...

[G5:~/test] shawnce% dd bs=1048576 if=/dev/random of=testfile count=1000
1000+0 records in
1000+0 records out
1048576000 bytes transferred in 110.249391 secs (9510946 bytes/sec)

Read it back...

[G5:~/test] shawnce% dd bs=1048576 if=testfile of=/dev/null count=1000
1000+0 records in
1000+0 records out
1048576000 bytes transferred in 1.358539 secs (771840867 bytes/sec) << 736 MB/s


[G5:~/test] shawnce% dd bs=1048576 if=testfile of=/dev/null count=1000
1000+0 records in
1000+0 records out
1048576000 bytes transferred in 1.330825 secs (787914210 bytes/sec) << 751 MB/s


...after a reboot...

[G5:~/test] shawnce% dd bs=1048576 if=testfile of=/dev/null count=1000
1000+0 records in
1000+0 records out
1048576000 bytes transferred in 36.230666 secs (28941670 bytes/sec) << 27.6 MB/s


[G5:~/test] shawnce% dd bs=1048576 if=testfile of=/dev/null count=1000
1000+0 records in
1000+0 records out
1048576000 bytes transferred in 1.226422 secs (854988041 bytes/sec) << 815 MB/s


It is also obvious if you watch the amount of inactive ram in use on the system. It will continue to grow and grow because it is being used by the file cache. Just read lots of files, open and close iPhoto, etc. to see it happen.

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

This email sent to email@hidden
References: 
 >Re: Mac OS X File IO Performance Issue? (From: Elliott Hughes <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.