The relative performance of molecular dynamics (MD) Computer simulations of
fluids written in ANSI C is compared to that achieved by a comparable prog
ram written in Java. The performance of the Java program is shown to be dep
endent upon its runtime environment. The Java Runtime Environment (JRE) fro
m the Java Development Kit (JDK) 1.2 provides a Just-In-Time (JIT) compiler
option on Solaris and Windows 95 platforms which decreases the execution t
ime by approximately 4 - 10x compared to the standard Java interpreter. The
compiled Java implementation of the MD computer simulation runs between 30
100% slower, depending on the platform. compared to the equivalent C imple
mentation. The stability of the two simulations, as measured by conservatio
n of energy is shown to be identical to within similar to1% over 10(5) time
steps.