[Biojava-l] Re: Java Resource Management [a semi troll...]

Brian King kingb_98 at yahoo.com
Mon Feb 10 11:21:11 EST 2003


Most of the bugs and version problems I've seen are in
the Java GUI libraries.  It can be difficult to write
GUI code that works the same way on all of your
supported platforms.  There isn't much of a way around
it other than a lot of testing.  Code to a common
version (1.3 now?), but test on several versions and
platforms.

Allocating memory in Java is expensive, so two
techniques that help with performance are reusing
objects rather than creating new ones, and using
object pools.  We improved performance over 25% on a
product that parsed genomic data by recoding that way.
 We used an optimizer to guide our performance tweaks
and validate the results. 

Also starting the JVM is expensive, so when you're
connecting processing steps together don't use Java
like a scripting language.  The JVM spends a lot of
time loading and verifying its class libraries when it
starts up, which can be overly redundant.  Rather than
piping results between processes, it's better to have
one process.

A C application will often execute faster than Java,
but Java is faster to develop and the resulting
application is more reliable.  

Best Regards,
Brian King




More information about the Biojava-l mailing list