Current results of "dictionary word count" programs...

Bryan Sant bryan.sant at
Mon Mar 13 12:33:48 MST 2006

Here are the current results for the "count the dictionary words in a
file" programs submitted thus far.

All programs were executed on my Ubuntu 5.10 system:
IBM Thinkpad T43 - Intel Pentium M 2.26GHz

I used /usr/share/dict/words as the dictionary (which contains 96274 words).
I used an uncompressed copy of /usr/share/doc/bash/changelog.gz as the
input file (which contains 42362 words).

C++ (GCC 4.0.2 with -O2)
LOC:  34
Best Time:  0.804
Worst Time:  2.087
Avg. Time:  1.44

Java (Sun 1.5)
LOC:  35
Best Time:  1.247
Worst Time:  1.622
Avg. Time:  1.54

Ruby 1.8.3 ("scripted" version)
LOC:  18
Best Time: 1.966
Worst Time:  3.297
Avg. Time:  2.35

Python 2.4.2 (bad algorithm?)
LOC: 6
Best Time: 31.724
Worst Time: 32.417
Avg. Time:  31.98

I'm still trying to get the lisp version to work (I have a load
error).  I'd like a good PHP and Perl version as well as a better
Python version (the python version isn't producing acurate output and
is WAY slower than is reasonable).


More information about the PLUG mailing list