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 Java Performance



On Thursday, July 31, 2003, at 12:21 PM, Shawn Erickson <email@hidden> wrote:

It is almost always
better to leverage platform provided framework/libraries/packages then
roll your own (unless you hit profiled performance issues or bugs, also
it is wise to use proven frameworks/libraries/packages). Doing so
results in less code that you have to write, test, and maintain. It
also makes you product compact, because it has less code in it.

I would call that the wiser solution...

-Shawn

Shawn,
Ideally, we would all like it to use provided frameworks/libraries/packages, etc.
Unfortunately, it isn't always that simple.
An example is why I stopped using HttpURLConnection. If you try to POST a sufficiently large file, guess what? You get an OutOfMemoryException. Why? The implementation buffers the whole request without the option of turning buffering off. HttpURLConnection turns out to be an incomplete implementation with many assumptions and shortcuts. Not really a bug or anything that would be caught by a profiler.

As for making your product more compact...you can work around the issue I pointed out above by using org.apache.commons.httpclient,
But doing so *can*--and often does--open a whole new "jar" of worms (and one of my biggest pet peeves) which is explained here: http://www.freeroller.net/page/fate/20030727#too_many_jars.

-Kristoff
_______________________________________________
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.



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.