• Red line: performance of your computer

  • Black line: a 2 Ghz Athlon

  • This applet runs a benchmark function, called "nfib" (see below for the function definition in Java).
  • Two speed graphs are drawn: a red line indicating the performance of your machine and a black line, which is the same test performed on a 2 Ghz AMD Athlon processor with Sun's JRE 1.5.0.
  • The plotted quantity is "the number of function calls per second" that your computer performs.
    static int nfib (int n) {
        if (n < 2) return (1);
        else return (1 + nfib(n-1) + nfib(n-2));
The nfib-function computes a (large) number that also happens to be the exact number of (recusive) function calls executed during the computation. Dividing this number by the CPU-time it took to calculate the result, one gets: "the number of nfib-funtion calls per second", an indication for the speed of the Java Virtual Machine. As you can see in the source text the benchmark involves:
  • addition, subtraction and comparison of 32-bit integers
  • function calls, with
  • parameter passing and returning results