The MD5 algorithm, in different programming languages

The purpose of this page is to present timing results which can be more or
less compared. The MD5 algorithm does quite a bit of integer math and is
sufficiently complex to consume measurable amounts of time (some timings
were clocked with a loop and a watch - all have 2-digit precision).

June 2001 - New optimized entries (all are based on inlining):

Note: Python's timings are due to unlimited-precision arithmetic, for a
hint that it could be in the 40..50 ms range, see ctmsg.txt and ctmd5.intpy.


(Latest Forth results as of Dec 18, 2000 are here)
   Language    Version     Time (ms)    Implementation

Linux SuSE 6.4 PIII/650:

   C           gcc 2.95.2      0.24     Portable compiled C

   iForth      1.11d           0.35     Native-code Forth [*]
   BigForth    1.22            1.5      Native-code Forth
   GForth      0.5.0          15        GCC-specific optimized C
   pForth      v21            59        Threaded VM in standard C
   Ficl        2.04           84        Threaded VM with C subr's

   Lua         4.0           150        Lua bytecode VM in C
   Tcl         8.4a2         180        Tcl bytecode VM in C
   Perl        5.005         230        Perl bytecode VM in C
   Python      2.0           460        Python bytecode VM in C

   [*] reported by Marcel Hendrix (modified, but still pure Forth)

MacOS 9.0.4 G3/300:

   Mops        4.01            2.9      Native-code Forth
   Tcl         8.4a2         380        Tcl bytecode VM in C


Notes

References

Unofficial MD5 homepage - by Mordechai T. Abzug
http://userpages.umbc.edu/~mabzug1/cs/md5/md5.html
Language implementations - various authors
BigForth - GForth - iForth - Mops - pForth - and - Lua - Perl - Python - Tcl
Forth - by Fredrick W. Warren
md5.fth (from comp.lang.forth)
Lua - by Jean-Claude Wippler
md5calc.lua
Perl - by Alex Rousskov
http://www.cs.ndsu.nodak.edu/~rousskov/research/cache/sanitar/
Python - by Christian Tismer
pymd5.py (on this site, not elsewhere AFAIK)
Tcl - by Don Libes
http://expect.nist.gov/md5pure/


-- Jean-Claude Wippler <jcw at equi4.com>