Java vs Python Benchmarks: Java is faster

dman dsh8290 at
Fri Feb 1 02:52:23 CET 2002

On Thu, Jan 31, 2002 at 09:06:52AM -0500, Bryan wrote:
| For what it is worth to people, I have taken the liberty of benchmarking 
| the new Java SDK ( 1.4.0 ) against Python 2.1 and 2.2.

| As a side note, I am very much a python proponent. Speed is not everything,
| otherwise we would still be coding in straight machine language :) If this 
| serves to debunk one pythoneer's baseless comments on the slow speed of 
| Java ( as it did to me ) then it has served its purpose.

I'm still not willing to give java the benefit of the doubt yet.

Did you try any GUI stuff in the tests?  Did you try any largish
programs?  In all my experiences running java apps (ie JBuilder,
'deploytool' from J2EE, IBM VisualAge for Java, Wilmascope (a J3D OSS
app), etc) they tend to be slow and memory hogs.  Interestingly
enough, too, there doesn't seem to be a way to increase the max heap
size of javac and I've seen it bomb with java.lang.OutOfMemoryError
trying to compile a large source tree while the system still had lots
of RAM/swap to play with.

A little while back I wrote a script in python to obfuscate package
and class names in a java source tree.  (for in-house use at my
current employer)  I used CPython 2.2 and a bunch of regexes for
identifying the occurences of the class/package names in the source
files.  It can process the whole 15MB source tree in about 30 seconds
and using no more than 7MB RAM at peak with 2-3MB most of the time.
I'll likely have to recode it in java (no one else there speaks
python), but I'll bet it won't be nearly as good (both in
terms of read/write-ability of the code and performance).

Any comments?


(admittedly I didn't yet follow the URL you posted, but I will check
it out later)


Your beauty should not come from outward adornment, such as braided hair
and the wearing of gold jewelry and fine clothes.  Instead, it should be
that of your inner self, the unfading beauty of a gentle and quiet
spirit, which is of GREAT WORTH in God's sight.  For this is the way the
holy women of the past used to make themselves beautiful.
        I Peter 3:3-5

More information about the Python-list mailing list