Performance measurements
© 2003 Jean-Marc Vanel

e-mail: Send your comments
My home page

Last update: 

Introduction

I wanted to have a clear idea of Java performance compared to C++. So I did a simple program with 1 billion of multiplications. Later I added tests for other ways of running a Java class. Still later I tested Eiffel, probably the best all-purposes language.

There are other execution environments possible. At the kaffe.org site, there are many projects aiming to run Java in unusual ways. While I was here, I tried kaffe 1.1.3; installation didn't succeed on Fedora Linux, so I posted a message on their list, and had a kind reply but alas it is not currently compatible with Fedora; I should retry with latest gcc and glibc.

The test machine is a 500 MHz PC with Fedora RedHat Linux; it is a network gateway so we don't get 100% of the CPU. So the figures are just an order of magnitude in a real-world situation. I could have taken in account the CPU% given by the time command.

MesurePerf.cpp - typescript-cpp.txt
MesurePerf.java - typescript-java.txt
Eiffel class

Results

Elapsed times in milliseconds.

Language
Platform and/or compiler
non optimized
optimized
Java
Sun JVM (1.4.2 or 1.5.0 beta)

38744
Java gcj 67645
22810
Java gij, GNU Java bytecode interpreter 743068

Java
Jikes RVM , an open source JVM from IBM 126923
15084
C++
gcc
18610
3690
Eiffel
ISE EIFFELSTUDIO
3570
Eiffel SmallEiffel 18772
10125

Comments