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: DataOutputStream performance under OS X



On Wednesday, July 30, 2003, at 09:38 AM, Jussi Hagman wrote:

Quoting Hall, Michael J. (email@hidden):
Machine configurations:
iMac, G3/350MHz, OS X 10.2.6, Java 1.4.1_01-58.1
PC1, 2xPPro 200MHz, Linux 2.2.22, Java Linux_JDK_1.2.2_RC4
PC2, 2xP3 700MHz, Linux 2.2.16, Java 1.4.0-b92

Including CPU speeds is almost pointless isn't it? When it comes
to I/O [...]

Maybe so, but when writing at 12kB/s the program is also using every
CPU-cycle available so perhaps it would be a bit faster with a faster
CPU... However, if I understood correctly this is as it it is supposed
to be. Thankfully I do not have the need to use Java at the moment. If
the need arises it seems that I'd probably be better off with another
operating system.

I think you missed the point - it is slow because it is not buffered. If you want buffering, wrap an appropriate buffered output stream around it. This improves speed on all platforms. Further, you can tune the buffer size to meet the measured needs of your program. Tuning the buffer size can make a big difference in performance.

Rather than using a different operating system, use the language as it is designed. God knows the Java I/O system is byzantine, arcane, and kludgy, but it _is_ quite capable of this kind of IO.

At one time, I used unbuffered IO streams for certain purposes - making sure that data gets to the disk immediately, for example, but even that was best done with OutputStream.flush() on a buffered stream.

Scott
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: DataOutputStream performance under OS X (From: Jussi Hagman <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.