[pypy-svn] r60552 - pypy/extradoc/talk/ecoop2009
antocuni at codespeak.net
antocuni at codespeak.net
Wed Dec 17 18:59:32 CET 2008
Author: antocuni
Date: Wed Dec 17 18:59:30 2008
New Revision: 60552
Modified:
pypy/extradoc/talk/ecoop2009/benchmarks.tex
Log:
add high level syntax of two benchmarks.
Modified: pypy/extradoc/talk/ecoop2009/benchmarks.tex
==============================================================================
--- pypy/extradoc/talk/ecoop2009/benchmarks.tex (original)
+++ pypy/extradoc/talk/ecoop2009/benchmarks.tex Wed Dec 17 18:59:30 2008
@@ -24,7 +24,9 @@
don't really like the last sentence, but right now I can't think of another
way to phrase it. Rewording welcome :-)}
-The benchmarks have been run on machine XXX with hardware YYY etc. etc.
+The benchmarks have been run on machine with Intel Pentium 4 CPU running at
+3.20 GHz and 2 GB of RAM, running Microsoft Windows XP and Microsoft .NET
+Framework 2.0.
\subsection{Arithmetic operations}
@@ -32,7 +34,16 @@
that computes the factorial of a given number. The algorithm is
straightforward, and the loop contains only three operations: one
multiplication, one subtraction, and one comparison to check if we have
-finished the job.
+finished the job:
+
+\begin{lstlisting}
+def main(n):
+ result = 1
+ while n > 1:
+ result = result * n
+ n = n - 1
+ return n
+\end{lstlisting}
When doing plain interpretation, we need to create and destroy three temporary
objects at each iterations. By contrast, the code generated by the JIT does
@@ -49,14 +60,31 @@
single CLI opcode (\lstinline{mul}, \lstinline{sub} and \lstinline{clt},
respectively).
-Moreover, we also wrote a program to calculate the $n_{th}$ Fibonacci number,
-for which we can do the same reasoning as above.
+Similarly, we wrote a program to calculate the $n_{th}$ Fibonacci number, for
+which we can do the same reasoning as above:
+
+\begin{lstlisting}
+def main(n):
+ a = 0
+ b = 1
+ while n > 1:
+ sum = a + b
+ a = b
+ b = sum
+ n = n - 1
+ return b
+\end{lstlisting}
+
+
Table XXX and figure XXX show the time spent to calculate the factorial of
various numbers, with and without the JIT. Table XXX and figure XXX show the
same informations for the Fibonacci program.
-\anto{Should we say that we get wrong results due to overflow but we don't care?}
+Note that do get meaningful timings, we had to calculate the factorial and
+Fibonacci of very high numbers. This means that the results are incorrect due
+to overflow, but since all the runnings overflows in the very same way, the
+timings are still comparable. \anto{I think we should rephrase this sentence}.
As we can see, the code generated by the JIT is almost 500 times faster than
the non-jitted case, and it is only about 1.5 times slower than the same
More information about the Pypy-commit
mailing list