Check out the new USENIX Web site. next up previous
Next: Lessons Learned Up: Related Work Previous: Comparison With Other Languages

Performance

Nickle's performance appears to be around 5 times slower than equivalent C code using the GNU GMP multiple-precision library, and quite a bit faster than GNU bc. Some simple benchmarks were run to compare the performance of Nickle 1.99.3, GNU bc 1.05, and C using GNU GMP 2.0. Four benchmarks were utilized: rfact computes $20000!$ using the obvious recursive implementation, ifact computes $20000!$ iteratively, choose computes $20000 \choose 5000$ (using ifact in the C and bc versions), and comp applies the Miller-Rabin test to the prime number $31957$ for every possible base from $1$ to $31956$. (The source of all of these benchmarks is available with the Nickle distribution.)

Table 1 shows Nickle execution times on an Athlon 700 with 256MB of RAM running Linux kernel 2.4.1 in single-user mode. All times are the minimum of 5 insignificantly different consecutive runs. (Nickle's built-in $!$ operator, while more convenient, produced similar timings to the hand-coded versions.) Nickle and GMP spent about 50% of total time on the factorial benchmarks generating and printing the decimal result (since there appears to be no easy way to inhibit this behavior in bc). The runtimes for these benchmarks are thus somewhat inflated. In general, the performance results are positive: the small performance hit over C code is more than made up for in ease of use.


Table 1: Benchmark execution time in seconds.
  bc Nickle GMP
ifact  67.6 5.7 3.4
rfact  67.8  6.0 3.3
choose 130.   6.3 1.8
comp  31.7  9.6 2.6


next up previous
Next: Lessons Learned Up: Related Work Previous: Comparison With Other Languages
Bart Massey 2001-04-19