Author: Carl Friedrich Bolz <[email protected]>
Branch: extradoc
Changeset: r4651:ad101b0bd63c
Date: 2012-08-17 09:43 +0200
http://bitbucket.org/pypy/extradoc/changeset/ad101b0bd63c/
Log: address review comments by mike pall
diff --git a/talk/dls2012/paper.tex b/talk/dls2012/paper.tex
--- a/talk/dls2012/paper.tex
+++ b/talk/dls2012/paper.tex
@@ -129,14 +129,16 @@
motion which is a very important optimization for code with tight kernels.
Especially for dynamic languages that typically perform quite a lot of loop
invariant
type checking, boxed value unwrapping and virtual method lookups.
+
In this paper we explain a scheme pioneered within the context of the LuaJIT
project
-for making simple optimizations loop-aware by
-using a simple pre-processing step on the trace and not changing the
+for making basic optimizations loop-aware by
+using a simple pre-processing step on the trace without changing the
optimizations themselves.
+
We have implemented the scheme in PyPy's tracing JIT compiler,
where it can give performance improvements of a
factor over two for PyPy's Python JIT executing simple numerical kernels
-bringing the performance close to that of compiled C code.
+bringing the performance into the ballpark of static language compilers.
\end{abstract}
\category{D.3.4}{Programming Languages}{Processors}[code generation,
@@ -185,10 +187,9 @@
2.0\footnote{\texttt{http://luajit.org/}}, an open source JIT compiler for the
Lua
language. His approach allows to reuse all forward pass
optimizations to achieve loop invariant code motion and other loop-related
-optimizations, which greatly simplifies the implementation. Using this scheme
-one does not need to change the underlying optimization much to get these
-advantages. We have implemented the same approach in PyPy's tracing JIT
-compiler the results of which we present here.
+optimizations, which greatly simplifies the implementation. We have implemented
+the same approach in PyPy's tracing JIT compiler, the results of which we
+present here.
The resulting optimizations one gets using this scheme are in no way novel,
most
of them are well-known loop optimizations. However, the way to implement them
is
@@ -1094,8 +1095,8 @@
The geometric mean of the
speedup of loop peeling is 70\%, which makes benchmark times
comparable with native-compiled C code. We attribute the performance gap to C
code to
-the relative immaturity of RPython's JIT machine code backend as well as
missing
-optimizations, like instruction scheduling. Also, in case of nested loops,
+the relative immaturity of RPython's JIT machine code backend and the naive
register allocator.
+Also, in case of nested loops,
operations are only moved out of the
innermost loop. That is an issue when the innermost loop is
short and a significant amount of time is spent in the outer loops. This is
the case
@@ -1104,7 +1105,9 @@
The speedups that LuaJIT gains from the loop optimization pass are similar to
those PyPy gains. In general, LuaJIT is even closer to C performance, sometimes
even surpassing it. LuaJIT is generating machine code of higher quality because
-it has a much better register allocator than PyPy, among other things.
+it has more optimizations\footnote{See
+\texttt{http://wiki.luajit.org/Optimizations}} and is a produces much better
+machine code than PyPy.
\section{Related Work}
\label{sec:related}
@@ -1171,7 +1174,7 @@
By using several benchmarks we show that the proposed algorithm can
significantly improve the run time of small loops containing numerical
-calculations.
+calculations.
The current approach still has some limitations which we plan to address in the
future. In particular loop peeling works poorly in combination with trace
@@ -1187,9 +1190,9 @@
\acks
We would like to thank Samuele Pedroni, Sven Hager and the anonymous reviewers
-for helpful comments on drafts of this paper. We owe deep gratitude to Mike
Pall
-for making his impressive work on LuaJIT available and for detailed help on a
-draft of the paper.
+for helpful comments on drafts of this paper. We owe gratitude to Mike Pall
+for making his impressive work on LuaJIT publicly available and for detailed
+reviews on drafts of the paper.
% We recommend abbrvnat bibliography style.
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit