Friday, June 22, 2007

Comparison of C, C++, Java, Perl, Python, Rexx, and Tcl.

Run Time :

Number of programs and name/version of compiler or interpreter used for the various languages. The Java evaluation uses either the JDK 1.2.2 Hotspot Reference version or the JDK 1.2.1 Solaris Production version (with JIT),whichever was faster for each program. All programs were executed on a 300MHz Sun Ultra-II workstation with 256MB memory, running under SunOS 5.7 (Solaris 7). Note that the results for C and Rexx will be based on only 5 or 4 programs, respectively, and are thus rather coarse estimates of reality,but for all of the other languages there are 10 or more programs,which is a broad-enough base for reasonably precise results.

####################################################################
language no. compiler or execution platform
-------- --- ----------------------------
Tcl 10 tcl 8.2.2
Rexx 4 Regina 0.08g
Python 13 python 1.5.2
Perl 13 perl 5.005_02
Java 24 Sun JDK 1.2.1/1.2.2
C++ 11 GNU g++ 2.7.2
C 5 GNU gcc 2.7.2
###################################################################
  • The typical (i.e., median) run time for Tcl is not significantly longer than that for Java or even for C++.
  • The median run times of both Python and Perl are smaller than those of Rexx and those of Tcl.
  • The median run time of Java is not significantly different from any of the others (not even Rexx, where p = 0:13).
  • Don’t be confused by the median for C++. Since the distance to the next larger and smaller points is rather large, it is unstable. The Wilcoxon test, which takes the whole sample into account, confirms that the C++ median in fact tends to be smaller than the Java median (p = 0:18).
  • The median run time of C is smaller than those of Java Rexx, and Tcl and tends to be smaller than those of Perl and Python.
  • Except for two very slow programs, Tcl and Perl run times tend to have a smaller variability than the run times for the other languages.

No comments: