Small Python, Java comparison

GerritM gmuller at worldonline.nl
Sat Jul 12 15:22:40 EDT 2003


"Dave Brueck" <dave at pythonapocrypha.com> schreef in bericht
news:mailman.1057953857.30422.python-list at python.org...
<...snip...> Java:
>From the start of the design to the end of the implementation and initial
round of bug fixing took 3 weeks. An additional 2-3 weeks were spent
optimizing the code and fixing more bugs. The source code had 4700 lines in
9
files. When running, it would process an average of 1050 records per second
(where process = time to parse the file, do calculations, and insert them
into the database).
<...snip...> Python:
Because I wasn't working on this full-time, the development was spread out
over the course of two weeks (10 working days) at an average of just over 2
hours per day (for a total of not quite 3 full days of work). The source
code
was less than 700 lines in 4 files. Most surprising to me was that it
processes an average of 1200 records per second! I had assumed that after I
got it working I'd need to spend time optimizing things to make up for Java
having a JIT compiler to speed things up, but for now I won't bother.

Both versions could be improved by splitting the log parsing/summarizing and
database work into two separate threads (watching the processes I see
periods
of high CPU usage followed by near-idle time while the database churns
away).
Currently the Java version averages 47% CPU utilization and the Python
version averages 51%.
<...snip...>

I recently wrote a short article about bloating of software:
"Exploration of the bloating of software"
www.extra.research.philips.com/natlab/sysarch/BloatingExploredPaper.pdf
(long URL may be broken in two by e-mail reader!).
I explain a number of effects I have observed which are caused by bloating,
one of them degradation of performance. This degradation is repaired which
causes again more bloating....

I think your small sample point is a clear illustration of the fact that
appropriate technology is important. Your gain of a factor of 6-7 in loc
will translate in comparable gains in maintenance, cost and ease of
extending etcetera.

thanks for sharing your experience, regards Gerrit



--
www.extra.research.philips.com/natlab/sysarch/






More information about the Python-list mailing list