[geeks] Misuse of Java
Greg A. Woods
woods at weird.com
Wed Nov 6 16:45:48 CST 2002
[ On Wednesday, November 6, 2002 at 17:31:25 (-0500), Joshua D Boyd wrote: ]
> Subject: Re: [geeks] Misuse of Java
>
> Now, I don't have that book, so would you mind telling me, what
> compilers did they use for Java?
I don't know, but the date and the test environments might give a hint:
"The Practice of Programming", Brian W. Kernighan and Rob Pike, 1999,
ISBN 0--201-61586-x (page 81):
The algorithm was a markov chain processor. The input was the Book of
Psalms from the King James Bible (42,685 words, 5,238 distinct words,
24,482 prefixes). Apparently they implemented a good C version first,
and then the others. The results summary table from the text is:
"The times in the following table are the number of seconds for
generating 10,000 words of output; one machine is a 250MHz MIPS R10000
running Irix 6.4 and the other is a 400MHz Pentium II with 128 megabytes
of memory running Windows NT. Run-time is almost entirely determined by
the input size; generation is very fast by comparison. The table also
includes the approximate program size in lines of source code.
250MHz 400 MHz Lines of
R10000 Pentium II source code
C 0.36 sec 0.30 sec 150
Java 4.9 9.2 105
C++/STL/deque 2.6 11.2 70
C++/STL/list 1.7 1.5 70
Awk 2.2 2.1 20
Perl 1.8 1.0 18
"The C and C++ versions were compiled with optimizing compilers, while
the Java runs had just-in-time compilers enabled. The Irix C and C++
times are the fastest obtained from three different compilers; similar
results were observed on Sun SPARC and DEC Alpha machines. The C
version of the program is fastest by a large factor; Perl comes second.
The times in the table area a snapshot of our experience with a
particular set of compilers and libraries, however, so you may see very
different results in your environment."
Note the above can also be found here:
http://eris.quintessential.com/users/gypsy/techie_stuff/lang_compare.txt
They also conclue on page 83:
"Production code takes much more effort than prototypes do, howwever. If
we think of the programs presented here as ``production code'' (since
they have been polished and thoroughly tested), production quality
requires one or two orders of magnitude more effort than a program
intended for personal use."
One of these days I'd like to compare Awk implementations with their
program. I suspect they used 'nawk', and while it's good, it may not be
the fastest. I should write a Smalltalk version just for practice too
and then I could compare GNU Smalltalk, Squeak, and other
implemenatations on a similar footing.
--
Greg A. Woods
+1 416 218-0098; <g.a.woods at ieee.org>; <woods at robohack.ca>
Planix, Inc. <woods at planix.com>; VE3TCP; Secrets of the Weird <woods at weird.com>
More information about the geeks
mailing list