[pypy-commit] extradoc extradoc: merge

fijal noreply at buildbot.pypy.org
Thu Aug 16 17:16:50 CEST 2012


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: extradoc
Changeset: r4623:0e39450935ed
Date: 2012-08-16 15:06 +0000
http://bitbucket.org/pypy/extradoc/changeset/0e39450935ed/

Log:	merge

diff --git a/talk/dls2012/licm.pdf b/talk/dls2012/licm.pdf
index 53e9a461f7d0e384c8c7fba88a6002c1337aaeb1..69f4a54d80bb6983114b698f3ac8e463a4831d1c
GIT binary patch

[cut]

diff --git a/talk/dls2012/paper.tex b/talk/dls2012/paper.tex
--- a/talk/dls2012/paper.tex
+++ b/talk/dls2012/paper.tex
@@ -125,7 +125,7 @@
 
 \begin{abstract}
 One of the nice properties of a tracing JIT is that many of its optimizations
-are simple requiring one forward pass only. This is not true for loop-invariant code
+are simple, requiring one forward pass only. This is not true for loop-invariant code
 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.
@@ -823,7 +823,7 @@
                  \cdots, m\left(\hat J_{|\hat J|}\right)\right)
   .
 \end{equation}
-In the optimized trace $I$ is replaced by $\hat I$ and $K$ by $\hat
+In the optimized trace $J$ is replaced by $\hat J$ and $K$ by $\hat
 K$. The trace from Figure~\ref{fig:unopt-trace} will be optimized to
 the trace in Figure~\ref{fig:virtual-trace}.
 
@@ -991,11 +991,13 @@
   fixpoint arithmetic with 16 bits precision. In Python there is only
   a single implementation of the benchmark that gets specialized
   depending on the class of it's input argument, $y$, while in C,
-  there are three different implementations.
+  there are three different implementations. In Lua there is no support for
+  integers so only two versions are provided: float and Fix16. Here Fix16 is a custom class
+  that implements scaled floating point arithmetic.
 \item {\bf conv3}$\left(n\right)$: one-dimensional convolution with fixed kernel-size $3$. A single loop
-is used to calculate a vector ${\bf b} = \left(b_1, \cdots, b_n\right)$ from a vector
+is used to calculate a vector ${\bf b} = \left(b_1, \cdots, b_{n-2}\right)$ from a vector
 ${\bf a} = \left(a_1, \cdots, a_n\right)$ and a kernel ${\bf k} = \left(k_1, k_2, k_3\right)$ using 
-$b_i = k_3 a_i + k_2 a_{i+1} + k_1 a_{i+2}$ for $1 \leq i \leq n$. Both the output vector, $\bf b$, 
+$b_i = k_3 a_i + k_2 a_{i+1} + k_1 a_{i+2}$ for $1 \leq i \leq n-2$. Both the output vector, $\bf b$, 
 and the input vectors, $\bf a$ and $\bf k$, are allocated prior to running the benchmark. It is executed 
 with $n=10^5$ and $n=10^6$.
 \item {\bf conv5}$\left(n\right)$: one-dimensional convolution with fixed kernel-size $5$. Similar to conv3, but with 
@@ -1014,7 +1016,7 @@
     k_{1,3} a_{i+1,j-1} &+& k_{1,2} a_{i+1,j} &+& k_{1,1} a_{i+1,j+1}  \\
   \end{array}
 \end{equation}
-for $1 \leq i \leq m$ and $1 \leq j \leq n$.
+for $2 \leq i \leq m-1$ and $2 \leq j \leq n-1$.
 The memory for storing the matrices are again allocated outside the benchmark and $(n,m)=(1000,1000)$ 
 as well as $(n,m)=(1000000,3)$ was used.
 \item {\bf dilate3x3}$\left(n\right)$: two-dimensional dilation with kernel of fixed
@@ -1051,7 +1053,7 @@
 For the C implementations it is
 implemented as a C++ class. The other benchmarks are implemented in
 plain C. All the benchmarks except sqrt operate on C double-precision floating
-point numbers, both in the Python and the C code.
+point numbers, both in the Python, C and Lua code.
 
 In addition we also ported the 
 SciMark\footnote{\texttt{http://math.nist.gov/scimark2/}} benchmakts to python, and compared 
@@ -1093,7 +1095,7 @@
 We also run PyPy with loop peeling optimization and without (but otherwise
 identical).
 
-For PyPy 10 iterations were run, prefaced with 3 iterations for warming up.
+For PyPy and Lua 10 iterations were run, prefaced with 3 iterations for warming up.
 Due to benchmarks taking large amounts of time on CPython, only one run
 was performed, prefaced with one warmup run for Psyco.
 For GCC 5 iterations
@@ -1107,7 +1109,11 @@
 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.
+optimizations, like instruction scheduling. 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 
+with for example SparseMatMult.
 
 Other interesting interpreters that are helped greatly by this optimization are
 for example our Prolog interpreter written in
@@ -1164,7 +1170,7 @@
 
 The type specialization described by Gal \etal~\cite{gal_trace-based_2009} can
 be seen as doing a similar optimization (again by manually implementing it)
-than the one described in Section~\ref{sub:allocation}: The effect of both is
+as the one described in Section~\ref{sub:allocation}: The effect of both is
 that type checks are fully done before a loop is even entered.
 
 
diff --git a/talk/vmil2012/figures/loop_bridge.graffle b/talk/vmil2012/figures/loop_bridge.graffle
--- a/talk/vmil2012/figures/loop_bridge.graffle
+++ b/talk/vmil2012/figures/loop_bridge.graffle
@@ -448,10 +448,11 @@
 {\colortbl;\red255\green255\blue255;}
 \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc
 
-\f0\fs20 \cf0 read ll resume data\
+\f0\fs20 \cf0 read backend map\
 decode resume data\
 retrieve stack and register values\
-...}</string>
+...\
+return to interpreter}</string>
 					</dict>
 				</dict>
 				<dict>
@@ -1038,7 +1039,7 @@
 {\colortbl;\red255\green255\blue255;}
 \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc
 
-\f0\fs24 \cf0 ll resume data #3}</string>
+\f0\fs24 \cf0 backend map #3}</string>
 			</dict>
 		</dict>
 		<dict>
@@ -1065,7 +1066,7 @@
 {\colortbl;\red255\green255\blue255;}
 \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc
 
-\f0\fs24 \cf0 ll resume data #4}</string>
+\f0\fs24 \cf0 backend map #4}</string>
 			</dict>
 		</dict>
 		<dict>
@@ -1098,7 +1099,7 @@
 {\colortbl;\red255\green255\blue255;}
 \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc
 
-\f0\fs24 \cf0 ll resume data #2}</string>
+\f0\fs24 \cf0 backend map #2}</string>
 			</dict>
 		</dict>
 		<dict>
@@ -1125,7 +1126,7 @@
 {\colortbl;\red255\green255\blue255;}
 \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc
 
-\f0\fs24 \cf0 ll resume data #1}</string>
+\f0\fs24 \cf0 backend map #1}</string>
 			</dict>
 		</dict>
 		<dict>
@@ -1653,7 +1654,7 @@
 	<key>MasterSheets</key>
 	<array/>
 	<key>ModificationDate</key>
-	<string>2012-08-07 12:49:27 +0000</string>
+	<string>2012-08-16 13:12:37 +0000</string>
 	<key>Modifier</key>
 	<string>David Schneider</string>
 	<key>NotesVisible</key>
diff --git a/talk/vmil2012/figures/loop_bridge.pdf b/talk/vmil2012/figures/loop_bridge.pdf
index 216fcb40e08cbcf7af9992945a531351d505cada..2ab2f100a98eb207b61317989adab5d0c3ea2003
GIT binary patch

[cut]

diff --git a/talk/vmil2012/figures/resume_data.graffle/QuickLook/Preview.pdf b/talk/vmil2012/figures/resume_data.graffle/QuickLook/Preview.pdf
index bb2ac8258feb15c2a137aee1d15be1b55c271e6c..1440be54554ae695a75458cfca6aa31ea1669f93
GIT binary patch

[cut]

diff --git a/talk/vmil2012/figures/resume_data.graffle/QuickLook/Thumbnail.tiff b/talk/vmil2012/figures/resume_data.graffle/QuickLook/Thumbnail.tiff
index 897a9752c8f4aecca86e7997f8addef92a074ce8..f0d05d18fc4b464dc50ae53e1becfa53486bd043
GIT binary patch

[cut]

diff --git a/talk/vmil2012/figures/resume_data.graffle/data.plist b/talk/vmil2012/figures/resume_data.graffle/data.plist
--- a/talk/vmil2012/figures/resume_data.graffle/data.plist
+++ b/talk/vmil2012/figures/resume_data.graffle/data.plist
@@ -44,19 +44,49 @@
 	<key>Creator</key>
 	<string>Carl Friedrich Bolz</string>
 	<key>DisplayScale</key>
-	<string>1 0/72 in = 1 0/72 in</string>
+	<string>1 0/72 in = 1.0000 in</string>
 	<key>GraphDocumentVersion</key>
 	<integer>8</integer>
 	<key>GraphicsList</key>
 	<array>
 		<dict>
+			<key>Bounds</key>
+			<string>{{151.809, 176.762}, {10.2668, 11.4967}}</string>
+			<key>Class</key>
+			<string>ShapedGraphic</string>
+			<key>ID</key>
+			<integer>112</integer>
+			<key>ImageID</key>
+			<integer>2</integer>
+			<key>Shape</key>
+			<string>Rectangle</string>
+			<key>Style</key>
+			<dict>
+				<key>fill</key>
+				<dict>
+					<key>Draws</key>
+					<string>NO</string>
+				</dict>
+				<key>shadow</key>
+				<dict>
+					<key>Draws</key>
+					<string>NO</string>
+				</dict>
+				<key>stroke</key>
+				<dict>
+					<key>Draws</key>
+					<string>NO</string>
+				</dict>
+			</dict>
+		</dict>
+		<dict>
 			<key>Class</key>
 			<string>LineGraphic</string>
 			<key>ControlPoints</key>
 			<array>
 				<string>{1.86659, 0}</string>
-				<string>{-10.3829, 10.3325}</string>
-				<string>{10.3829, -10.3325}</string>
+				<string>{-22.5, 11.5}</string>
+				<string>{22.5, -11.5}</string>
 				<string>{-14.3108, 17.8072}</string>
 			</array>
 			<key>Head</key>
@@ -68,9 +98,9 @@
 			<integer>97</integer>
 			<key>Points</key>
 			<array>
-				<string>{151.883, 268.25}</string>
-				<string>{171.25, 259.676}</string>
-				<string>{214.187, 206.249}</string>
+				<string>{151.883, 261.676}</string>
+				<string>{209.5, 248.426}</string>
+				<string>{268.5, 206.703}</string>
 			</array>
 			<key>Style</key>
 			<dict>
@@ -102,7 +132,7 @@
 			<key>Points</key>
 			<array>
 				<string>{169.625, 196.625}</string>
-				<string>{214.01, 205.759}</string>
+				<string>{268.5, 206.703}</string>
 			</array>
 			<key>Style</key>
 			<dict>
@@ -124,7 +154,7 @@
 			<array>
 				<dict>
 					<key>Bounds</key>
-					<string>{{274.103, 226.344}, {8, 9}}</string>
+					<string>{{327.641, 225.256}, {10.2668, 11.4967}}</string>
 					<key>Class</key>
 					<string>ShapedGraphic</string>
 					<key>ID</key>
@@ -159,7 +189,7 @@
 					<array>
 						<dict>
 							<key>Bounds</key>
-							<string>{{214.5, 213.302}, {75.3968, 33.5389}}</string>
+							<string>{{268.5, 214.145}, {75.3968, 33.5389}}</string>
 							<key>Class</key>
 							<string>ShapedGraphic</string>
 							<key>ID</key>
@@ -196,7 +226,7 @@
 						</dict>
 						<dict>
 							<key>Bounds</key>
-							<string>{{214.5, 196.841}, {75.3968, 18.037}}</string>
+							<string>{{268.5, 197.684}, {75.3968, 18.037}}</string>
 							<key>Class</key>
 							<string>ShapedGraphic</string>
 							<key>ID</key>
@@ -315,7 +345,7 @@
 {\colortbl;\red255\green255\blue255;}
 \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
 
-\f0\fs24 \cf0 Guard 4}</string>
+\f0\fs24 \cf0 Guard 1}</string>
 				<key>VerticalPad</key>
 				<integer>0</integer>
 			</dict>
@@ -324,95 +354,217 @@
 		</dict>
 		<dict>
 			<key>Class</key>
-			<string>LineGraphic</string>
-			<key>Head</key>
-			<dict>
-				<key>ID</key>
-				<integer>66</integer>
-			</dict>
-			<key>ID</key>
-			<integer>84</integer>
-			<key>Points</key>
+			<string>Group</string>
+			<key>Graphics</key>
 			<array>
-				<string>{93.2062, 93.1111}</string>
-				<string>{123.778, 93.0926}</string>
-			</array>
-			<key>Style</key>
-			<dict>
-				<key>stroke</key>
 				<dict>
-					<key>HeadArrow</key>
-					<string>FilledArrow</string>
-					<key>LineType</key>
-					<integer>1</integer>
-					<key>TailArrow</key>
-					<string>0</string>
+					<key>Class</key>
+					<string>LineGraphic</string>
+					<key>Head</key>
+					<dict>
+						<key>ID</key>
+						<integer>110</integer>
+					</dict>
+					<key>ID</key>
+					<integer>104</integer>
+					<key>Points</key>
+					<array>
+						<string>{93.2062, 99.6852}</string>
+						<string>{123.778, 99.6667}</string>
+					</array>
+					<key>Style</key>
+					<dict>
+						<key>stroke</key>
+						<dict>
+							<key>HeadArrow</key>
+							<string>FilledArrow</string>
+							<key>LineType</key>
+							<integer>1</integer>
+							<key>TailArrow</key>
+							<string>0</string>
+						</dict>
+					</dict>
+					<key>Tail</key>
+					<dict>
+						<key>ID</key>
+						<integer>105</integer>
+						<key>Info</key>
+						<integer>3</integer>
+					</dict>
 				</dict>
-			</dict>
-			<key>Tail</key>
-			<dict>
-				<key>ID</key>
-				<integer>82</integer>
-				<key>Info</key>
-				<integer>3</integer>
-			</dict>
-		</dict>
-		<dict>
-			<key>Bounds</key>
-			<string>{{49.2062, 86.1111}, {44, 14}}</string>
-			<key>Class</key>
-			<string>ShapedGraphic</string>
-			<key>FitText</key>
-			<string>YES</string>
-			<key>Flow</key>
-			<string>Resize</string>
-			<key>ID</key>
-			<integer>82</integer>
-			<key>Magnets</key>
-			<array>
-				<string>{0, 1}</string>
-				<string>{0, -1}</string>
-				<string>{1, 0}</string>
-				<string>{-1, 0}</string>
-			</array>
-			<key>Shape</key>
-			<string>Rectangle</string>
-			<key>Style</key>
-			<dict>
-				<key>fill</key>
 				<dict>
-					<key>Draws</key>
+					<key>Bounds</key>
+					<string>{{49.2062, 92.6852}, {44, 14}}</string>
+					<key>Class</key>
+					<string>ShapedGraphic</string>
+					<key>FitText</key>
+					<string>YES</string>
+					<key>Flow</key>
+					<string>Resize</string>
+					<key>ID</key>
+					<integer>105</integer>
+					<key>Magnets</key>
+					<array>
+						<string>{0, 1}</string>
+						<string>{0, -1}</string>
+						<string>{1, 0}</string>
+						<string>{-1, 0}</string>
+					</array>
+					<key>Shape</key>
+					<string>Rectangle</string>
+					<key>Style</key>
+					<dict>
+						<key>fill</key>
+						<dict>
+							<key>Draws</key>
+							<string>NO</string>
+						</dict>
+						<key>shadow</key>
+						<dict>
+							<key>Draws</key>
+							<string>NO</string>
+						</dict>
+						<key>stroke</key>
+						<dict>
+							<key>Draws</key>
+							<string>NO</string>
+						</dict>
+					</dict>
+					<key>Text</key>
+					<dict>
+						<key>Align</key>
+						<integer>0</integer>
+						<key>Pad</key>
+						<integer>0</integer>
+						<key>Text</key>
+						<string>{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf540
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
+
+\f0\fs24 \cf0 Guard 2}</string>
+						<key>VerticalPad</key>
+						<integer>0</integer>
+					</dict>
+					<key>Wrap</key>
 					<string>NO</string>
 				</dict>
-				<key>shadow</key>
 				<dict>
-					<key>Draws</key>
-					<string>NO</string>
-				</dict>
-				<key>stroke</key>
-				<dict>
-					<key>Draws</key>
-					<string>NO</string>
-				</dict>
-			</dict>
-			<key>Text</key>
-			<dict>
-				<key>Align</key>
-				<integer>0</integer>
-				<key>Pad</key>
-				<integer>0</integer>
-				<key>Text</key>
-				<string>{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf540
+					<key>Class</key>
+					<string>Group</string>
+					<key>Graphics</key>
+					<array>
+						<dict>
+							<key>Bounds</key>
+							<string>{{152.838, 118.541}, {10.2668, 11.4967}}</string>
+							<key>Class</key>
+							<string>ShapedGraphic</string>
+							<key>ID</key>
+							<integer>107</integer>
+							<key>ImageID</key>
+							<integer>2</integer>
+							<key>Shape</key>
+							<string>Rectangle</string>
+							<key>Style</key>
+							<dict>
+								<key>fill</key>
+								<dict>
+									<key>Draws</key>
+									<string>NO</string>
+								</dict>
+								<key>shadow</key>
+								<dict>
+									<key>Draws</key>
+									<string>NO</string>
+								</dict>
+								<key>stroke</key>
+								<dict>
+									<key>Draws</key>
+									<string>NO</string>
+								</dict>
+							</dict>
+						</dict>
+						<dict>
+							<key>Class</key>
+							<string>Group</string>
+							<key>Graphics</key>
+							<array>
+								<dict>
+									<key>Bounds</key>
+									<string>{{123.778, 107.109}, {91.222, 33.5389}}</string>
+									<key>Class</key>
+									<string>ShapedGraphic</string>
+									<key>ID</key>
+									<integer>109</integer>
+									<key>Magnets</key>
+									<array>
+										<string>{0, 1}</string>
+										<string>{0, -1}</string>
+										<string>{1, 0}</string>
+										<string>{-1, 0}</string>
+									</array>
+									<key>Shape</key>
+									<string>Rectangle</string>
+									<key>Style</key>
+									<dict/>
+									<key>Text</key>
+									<dict>
+										<key>Align</key>
+										<integer>0</integer>
+										<key>Text</key>
+										<string>{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf540
+{\fonttbl\f0\fnil\fcharset0 Monaco;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
+
+\f0\fs20 \cf0 n =        }</string>
+									</dict>
+								</dict>
+								<dict>
+									<key>Bounds</key>
+									<string>{{123.778, 90.6482}, {91.222, 18.037}}</string>
+									<key>Class</key>
+									<string>ShapedGraphic</string>
+									<key>ID</key>
+									<integer>110</integer>
+									<key>Magnets</key>
+									<array>
+										<string>{0, 1}</string>
+										<string>{0, -1}</string>
+										<string>{1, 0}</string>
+										<string>{-1, 0}</string>
+									</array>
+									<key>Shape</key>
+									<string>Rectangle</string>
+									<key>Text</key>
+									<dict>
+										<key>Text</key>
+										<string>{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf540
 {\fonttbl\f0\fswiss\fcharset0 Helvetica;}
 {\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
 
-\f0\fs24 \cf0 Guard 5}</string>
-				<key>VerticalPad</key>
-				<integer>0</integer>
-			</dict>
-			<key>Wrap</key>
-			<string>NO</string>
+\f0\fs24 \cf0 build}</string>
+									</dict>
+								</dict>
+							</array>
+							<key>ID</key>
+							<integer>108</integer>
+						</dict>
+					</array>
+					<key>ID</key>
+					<integer>106</integer>
+					<key>Magnets</key>
+					<array>
+						<string>{0, 1}</string>
+						<string>{0, -1}</string>
+						<string>{1, 0}</string>
+						<string>{-1, 0}</string>
+					</array>
+				</dict>
+			</array>
+			<key>ID</key>
+			<integer>103</integer>
 		</dict>
 		<dict>
 			<key>Class</key>
@@ -426,8 +578,8 @@
 			<integer>81</integer>
 			<key>Points</key>
 			<array>
-				<string>{152.074, 206}</string>
-				<string>{152.074, 227.926}</string>
+				<string>{169.389, 206}</string>
+				<string>{169.389, 221.352}</string>
 			</array>
 			<key>Style</key>
 			<dict>
@@ -451,7 +603,7 @@
 		</dict>
 		<dict>
 			<key>Bounds</key>
-			<string>{{151.383, 250.676}, {8, 9}}</string>
+			<string>{{151.809, 243.478}, {9.70044, 10.2484}}</string>
 			<key>Class</key>
 			<string>ShapedGraphic</string>
 			<key>ID</key>
@@ -486,7 +638,7 @@
 			<array>
 				<dict>
 					<key>Bounds</key>
-					<string>{{123.778, 244.387}, {56.5927, 33.5389}}</string>
+					<string>{{123.778, 237.813}, {91.222, 33.5389}}</string>
 					<key>Class</key>
 					<string>ShapedGraphic</string>
 					<key>FontInfo</key>
@@ -523,7 +675,7 @@
 				</dict>
 				<dict>
 					<key>Bounds</key>
-					<string>{{123.778, 227.926}, {56.5927, 18.037}}</string>
+					<string>{{123.778, 221.352}, {91.222, 18.037}}</string>
 					<key>Class</key>
 					<string>ShapedGraphic</string>
 					<key>FontInfo</key>
@@ -550,7 +702,7 @@
 {\colortbl;\red255\green255\blue255;}
 \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
 
-\f0\fs24 \cf0 f}</string>
+\f0\fs24 \cf0 check_reduces}</string>
 					</dict>
 				</dict>
 			</array>
@@ -571,8 +723,8 @@
 			<integer>73</integer>
 			<key>Points</key>
 			<array>
-				<string>{152.074, 134.074}</string>
-				<string>{152.074, 156}</string>
+				<string>{169.389, 140.648}</string>
+				<string>{169.389, 156}</string>
 			</array>
 			<key>Style</key>
 			<dict>
@@ -589,7 +741,7 @@
 			<key>Tail</key>
 			<dict>
 				<key>ID</key>
-				<integer>65</integer>
+				<integer>109</integer>
 				<key>Info</key>
 				<integer>1</integer>
 			</dict>
@@ -601,7 +753,7 @@
 			<array>
 				<dict>
 					<key>Bounds</key>
-					<string>{{152, 179}, {8, 9}}</string>
+					<string>{{123.778, 172.461}, {91.222, 33.5389}}</string>
 					<key>Class</key>
 					<string>ShapedGraphic</string>
 					<key>FontInfo</key>
@@ -612,233 +764,67 @@
 						<real>10</real>
 					</dict>
 					<key>ID</key>
-					<integer>68</integer>
-					<key>ImageID</key>
-					<integer>2</integer>
+					<integer>70</integer>
+					<key>Magnets</key>
+					<array>
+						<string>{0, 1}</string>
+						<string>{0, -1}</string>
+						<string>{1, 0}</string>
+						<string>{-1, 0}</string>
+					</array>
 					<key>Shape</key>
 					<string>Rectangle</string>
 					<key>Style</key>
+					<dict/>
+					<key>Text</key>
 					<dict>
-						<key>fill</key>
-						<dict>
-							<key>Draws</key>
-							<string>NO</string>
-						</dict>
-						<key>shadow</key>
-						<dict>
-							<key>Draws</key>
-							<string>NO</string>
-						</dict>
-						<key>stroke</key>
-						<dict>
-							<key>Draws</key>
-							<string>NO</string>
-						</dict>
-					</dict>
-				</dict>
-				<dict>
-					<key>Class</key>
-					<string>Group</string>
-					<key>Graphics</key>
-					<array>
-						<dict>
-							<key>Bounds</key>
-							<string>{{123.778, 172.461}, {56.5927, 33.5389}}</string>
-							<key>Class</key>
-							<string>ShapedGraphic</string>
-							<key>FontInfo</key>
-							<dict>
-								<key>Font</key>
-								<string>Monaco</string>
-								<key>Size</key>
-								<real>10</real>
-							</dict>
-							<key>ID</key>
-							<integer>70</integer>
-							<key>Magnets</key>
-							<array>
-								<string>{0, 1}</string>
-								<string>{0, -1}</string>
-								<string>{1, 0}</string>
-								<string>{-1, 0}</string>
-							</array>
-							<key>Shape</key>
-							<string>Rectangle</string>
-							<key>Style</key>
-							<dict/>
-							<key>Text</key>
-							<dict>
-								<key>Align</key>
-								<integer>0</integer>
-								<key>Text</key>
-								<string>{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf540
+						<key>Align</key>
+						<integer>0</integer>
+						<key>Text</key>
+						<string>{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf540
 {\fonttbl\f0\fnil\fcharset0 Monaco;}
 {\colortbl;\red255\green255\blue255;}
 \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
 
 \f0\fs20 \cf0 n =\
 self =         }</string>
-							</dict>
-						</dict>
-						<dict>
-							<key>Bounds</key>
-							<string>{{123.778, 156}, {56.5927, 18.037}}</string>
-							<key>Class</key>
-							<string>ShapedGraphic</string>
-							<key>FontInfo</key>
-							<dict>
-								<key>Font</key>
-								<string>Monaco</string>
-								<key>Size</key>
-								<real>10</real>
-							</dict>
-							<key>ID</key>
-							<integer>71</integer>
-							<key>Magnets</key>
-							<array>
-								<string>{0, 1}</string>
-								<string>{0, -1}</string>
-							</array>
-							<key>Shape</key>
-							<string>Rectangle</string>
-							<key>Text</key>
-							<dict>
-								<key>Text</key>
-								<string>{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf540
+					</dict>
+				</dict>
+				<dict>
+					<key>Bounds</key>
+					<string>{{123.778, 156}, {91.222, 18.037}}</string>
+					<key>Class</key>
+					<string>ShapedGraphic</string>
+					<key>FontInfo</key>
+					<dict>
+						<key>Font</key>
+						<string>Monaco</string>
+						<key>Size</key>
+						<real>10</real>
+					</dict>
+					<key>ID</key>
+					<integer>71</integer>
+					<key>Magnets</key>
+					<array>
+						<string>{0, 1}</string>
+						<string>{0, -1}</string>
+					</array>
+					<key>Shape</key>
+					<string>Rectangle</string>
+					<key>Text</key>
+					<dict>
+						<key>Text</key>
+						<string>{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf540
 {\fonttbl\f0\fswiss\fcharset0 Helvetica;}
 {\colortbl;\red255\green255\blue255;}
 \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
 
-\f0\fs24 \cf0 even}</string>
-							</dict>
-						</dict>
-					</array>
-					<key>ID</key>
-					<integer>69</integer>
+\f0\fs24 \cf0 Even.step}</string>
+					</dict>
 				</dict>
 			</array>
 			<key>ID</key>
-			<integer>67</integer>
-			<key>Magnets</key>
-			<array>
-				<string>{0, 1}</string>
-				<string>{0, -1}</string>
-				<string>{1, 0}</string>
-				<string>{-1, 0}</string>
-			</array>
-		</dict>
-		<dict>
-			<key>Class</key>
-			<string>Group</string>
-			<key>Graphics</key>
-			<array>
-				<dict>
-					<key>Bounds</key>
-					<string>{{152.593, 113.333}, {8, 9}}</string>
-					<key>Class</key>
-					<string>ShapedGraphic</string>
-					<key>ID</key>
-					<integer>63</integer>
-					<key>ImageID</key>
-					<integer>2</integer>
-					<key>Shape</key>
-					<string>Rectangle</string>
-					<key>Style</key>
-					<dict>
-						<key>fill</key>
-						<dict>
-							<key>Draws</key>
-							<string>NO</string>
-						</dict>
-						<key>shadow</key>
-						<dict>
-							<key>Draws</key>
-							<string>NO</string>
-						</dict>
-						<key>stroke</key>
-						<dict>
-							<key>Draws</key>
-							<string>NO</string>
-						</dict>
-					</dict>
-				</dict>
-				<dict>
-					<key>Class</key>
-					<string>Group</string>
-					<key>Graphics</key>
-					<array>
-						<dict>
-							<key>Bounds</key>
-							<string>{{123.778, 100.535}, {56.5927, 33.5389}}</string>
-							<key>Class</key>
-							<string>ShapedGraphic</string>
-							<key>ID</key>
-							<integer>65</integer>
-							<key>Magnets</key>
-							<array>
-								<string>{0, 1}</string>
-								<string>{0, -1}</string>
-								<string>{1, 0}</string>
-								<string>{-1, 0}</string>
-							</array>
-							<key>Shape</key>
-							<string>Rectangle</string>
-							<key>Style</key>
-							<dict/>
-							<key>Text</key>
-							<dict>
-								<key>Align</key>
-								<integer>0</integer>
-								<key>Text</key>
-								<string>{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf540
-{\fonttbl\f0\fnil\fcharset0 Monaco;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural
-
-\f0\fs20 \cf0 n =        }</string>
-							</dict>
-						</dict>
-						<dict>
-							<key>Bounds</key>
-							<string>{{123.778, 84.0741}, {56.5927, 18.037}}</string>
-							<key>Class</key>
-							<string>ShapedGraphic</string>
-							<key>ID</key>
-							<integer>66</integer>
-							<key>Magnets</key>
-							<array>
-								<string>{0, 1}</string>
-								<string>{0, -1}</string>
-								<string>{1, 0}</string>
-								<string>{-1, 0}</string>
-							</array>
-							<key>Shape</key>
-							<string>Rectangle</string>
-							<key>Text</key>
-							<dict>
-								<key>Text</key>
-								<string>{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf540
-{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
-
-\f0\fs24 \cf0 build}</string>
-							</dict>
-						</dict>
-					</array>
-					<key>ID</key>
-					<integer>64</integer>
-				</dict>
-			</array>
-			<key>ID</key>
-			<integer>62</integer>
-			<key>Magnets</key>
-			<array>
-				<string>{0, 1}</string>
-				<string>{0, -1}</string>
-				<string>{1, 0}</string>
-				<string>{-1, 0}</string>
-			</array>
+			<integer>69</integer>
 		</dict>
 	</array>
 	<key>GridInfo</key>
@@ -3026,7 +3012,7 @@
 	<key>MasterSheets</key>
 	<array/>
 	<key>ModificationDate</key>
-	<string>2012-08-08 14:34:46 +0200</string>
+	<string>2012-08-16 14:38:57 +0200</string>
 	<key>Modifier</key>
 	<string>Carl Friedrich Bolz</string>
 	<key>NotesVisible</key>
@@ -3090,12 +3076,7 @@
 		<key>CurrentSheet</key>
 		<integer>0</integer>
 		<key>ExpandedCanvases</key>
-		<array>
-			<dict>
-				<key>name</key>
-				<string>Canvas 1</string>
-			</dict>
-		</array>
+		<array/>
 		<key>Frame</key>
 		<string>{{141, 148}, {1041, 989}}</string>
 		<key>ListView</key>
@@ -3111,15 +3092,15 @@
 		<key>SidebarWidth</key>
 		<integer>120</integer>
 		<key>VisibleRegion</key>
-		<string>{{0, 0}, {446, 410}}</string>
+		<string>{{36.2264, 33.9623}, {336.604, 309.434}}</string>
 		<key>Zoom</key>
-		<real>2</real>
+		<real>2.6500000953674316</real>
 		<key>ZoomValues</key>
 		<array>
 			<array>
 				<string>Canvas 1</string>
-				<real>2</real>
-				<real>4</real>
+				<real>2.6500000953674316</real>
+				<real>0.0</real>
 			</array>
 		</array>
 	</dict>
diff --git a/talk/vmil2012/figures/resume_data.pdf b/talk/vmil2012/figures/resume_data.pdf
index 0f7081ecd847e11eed1b055b94f8db949049ec9b..3e8adeb60dcbfba8b2a63a1abb7659bcf61b7fb8
GIT binary patch

[cut]

diff --git a/talk/vmil2012/jit-guards_submitted.pdf b/talk/vmil2012/jit-guards_submitted.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..b4217c0485655a735cc1246d0c8155feb223dcf0
GIT binary patch

[cut]

diff --git a/talk/vmil2012/paper.tex b/talk/vmil2012/paper.tex
--- a/talk/vmil2012/paper.tex
+++ b/talk/vmil2012/paper.tex
@@ -24,9 +24,12 @@
 
 \definecolor{commentgray}{rgb}{0.3,0.3,0.3}
 
+\lstdefinelanguage{none}{
+      keywords={},
+}
 \lstset{
   basicstyle=\ttfamily\footnotesize,
-  language=Python,
+  language=none,
   keywordstyle=\bfseries,
   stringstyle=\color{blue},
   commentstyle=\color{commentgray}\textit,
@@ -82,11 +85,14 @@
 
 \renewcommand\cite[1]{\ifthenelse{\equal{#1}{XXX}}{[citation~needed]}{\oldcite{#1}}}
 
+\let\oldlstinline=\lstinline
+\renewcommand\lstinline[1]{\oldlstinline[basicstyle=\ttfamily]{#1}}
+
 \definecolor{gray}{rgb}{0.5,0.5,0.5}
 
 \begin{document}
 
-\title{The Efficient Handling of Guards in the Design of RPython's Tracing JIT}
+\title{The Efficient Handling of Guards \\in the Design of RPython's Tracing JIT}
 
 \authorinfo{David Schneider$^{a}$ \and Carl Friedrich Bolz$^a$}
            {$^a$Heinrich-Heine-Universit&#228;t D&#252;sseldorf, STUPS Group, Germany
@@ -121,7 +127,6 @@
 
 
 %___________________________________________________________________________
-\todo{better formatting for lstinline}
 \section{Introduction}
 
 Tracing just-in-time (JIT) compilers record and compile commonly executed
@@ -140,30 +145,30 @@
 frequency and the overhead related to guards.
 
 It is important to handle guards well, because they are very common operations
-in the traces produced by tracing JITs. As can be seen in
-Figure~\ref{fig:guard_percent} guards account for about 14\% to 22\% of the
+in the traces produced by tracing JITs. As we will see later (Figure~\ref{fig:benchmarks})
+guards account for about 14\% to 22\% of the
 operations before and for about 15\% to 20\% of the operations after optimizing
 the traces generated for the different benchmarks used in this paper. An
 additional property is that guard failure rates are very uneven. The majority
 of guards never fail at all, whereas those that do usually fail extremely
 often.
 
-Besides being common, guards have various costs attached to them.
+Besides being common, guards have various costs associated with them.
 Guards have a runtime cost, they take time to execute. Therefore it is
 important to make the on-trace execution of guards as efficient as possible. On
 the other hand, guards are possible deoptimization points. The recorded and
 compiled path has to be left if a guard fails, returning control to the
 interpreter. Therefore guards need enough associated information to enable
 rebuilding the interpreter state. The memory overhead of this information
-should be kept low. These constraints and trade-offs are what make the design
+should be kept low. These constraints and trade-offs are what makes the design
 and optimization of guards an important and non-trivial aspect of the construction
 of a tracing just-in-time compiler.
 
 %Section~\ref{sec:Evaluation} presents Figures about the absolute number of
 %operations for each benchmark, and the overhead produced by the information
 %stored at the different levels for the guards
-In this paper we want to substantiate the aforementioned observations and
-describe based on them the reasoning behind the implementation of guards in
+In this paper we want to substantiate the aforementioned observations about guards and
+describe based on them the reasoning behind their implementation in
 RPython's tracing just-in-time compiler. the contributions of this paper are:
 \begin{itemize}
   \item an analysis and benchmark of guards in the context of RPython's tracing JIT,
@@ -175,12 +180,6 @@
   and low-level components of the JIT and describe the rationale behind the design
 \end{itemize}
 
-\begin{figure}
-    \include{figures/guard_table}
-    \caption{Percentage of guards before and after optimization for different benchmarks}
-    \label{fig:guard_percent}
-\end{figure}
-
 The set of central concepts upon which this work is based are described in
 Section~\ref{sec:Background}, such as the PyPy project, the RPython language
 and its meta-tracing JIT. Based on these concepts in Section~\ref{sec:Resume
@@ -367,7 +366,7 @@
 \label{sub:compression}
 
 After tracing has been finished the trace is optimized.
-During optimization a large percentage of operations can be removed. \todo{add a reference to the figure showing the optimization rates?}
+During optimization a large percentage of operations can be removed (Figure~\ref{fig:benchmarks}).
 In the process the resume data is transformed into its final, compressed form.
 The rationale for not compressing the resume data during tracing
 is that a lot of guards will be optimized away.
@@ -480,8 +479,6 @@
 \lstinline{Even.step} as well as the description of the allocation-removed
 virtual instance of \lstinline{Even} are shared between the two guards.
 
-\todo{fix labels in diagram}
-
 % section Resume Data (end)
 
 \begin{figure}
@@ -494,7 +491,7 @@
 \label{sec:Guards in the Backend}
 
 \begin{figure}
-\includegraphics[width=0.5\textwidth]{figures/resume_data.pdf}
+\includegraphics[width=0.4\textwidth]{figures/resume_data.pdf}
 \caption{The resume data for Figure~\ref{fig:trace-log}}
 \label{fig:resume-data}
 \end{figure}
@@ -636,7 +633,6 @@
 
 \section{Evaluation}
 \label{sec:evaluation}
-\todo{improve the table formatting}
 
 The results presented in this section are based on numbers gathered by running
 a subset of the standard PyPy benchmarks. The PyPy benchmarks are used to
@@ -706,7 +702,7 @@
     \label{fig:benchmarks}
 \end{figure*}
 
-Figure~\ref{fig:benchmarks} extends Figure~\ref{fig:guard_percent} and summarizes the total number of operations that were
+Figure~\ref{fig:benchmarks} summarizes the total number of operations that were
 recorded during tracing for each of the benchmarks and what percentage of these
 operations are guards. The number of operations was counted on the unoptimized
 and optimized traces. The figure also shows the overall optimization rate for
@@ -759,7 +755,7 @@
     \include{figures/backend_table}
     \caption{Total size of generated machine code and resume data}
     \label{fig:backend_data}
-\end{figure}e.
+\end{figure}
 
 Why the efficient storing of the resume data is a central concern in the design
 of guards is illustrated by Figure~\ref{fig:resume_data_sizes}. This figure shows
@@ -795,7 +791,7 @@
 
 \begin{figure}
     \include{figures/failing_guards_table}
-    \caption{Failing guards relative to the total number of guards}
+    \caption{Failing guards, guards with more than 200 failures and guards responsible for 50\% of the failures relative to the total number of guards}
     \label{fig:failing_guards}
 \end{figure}
 
@@ -804,7 +800,10 @@
 2.4\% and 5.7\% of all guards. As can be expected, even fewer guards fail often
 enough that a bridge is compiled for them, only 1.2\% to 3.6\% of all guards
 fail often enough that a bridge is compiled. Also, of all failing guards a few fail extremely often
-and most fail rarely. The results emphasize that as most of the guards never
+and most fail rarely. Reinforcing this notion the figure shows that, depending on the
+benchmark, between 0.008\% and 0.225\% of the guards are responsible for 50\%
+of the total guards failures.
+These results emphasize that as most of the guards never
 fail it is important to make sure that the successful execution of a guard does
 not have unnecessary overhead.
 
@@ -963,6 +962,10 @@
 \section*{Acknowledgements}
 We would like to thank David Edelsohn, Samuele Pedroni and Stephan Zalewski for their helpful
 feedback and valuable comments while writing this paper.
+We thank the PyPy and RPython community for their continuous support and work:
+Armin Rigo, Antonio Cuni, Maciej Fija&#322;kowski, Samuele Pedroni, and countless
+others. Any remaining errors are our own.
+
 
 %\section*{Appendix}
 %\todo{remove this section and the figures}
@@ -980,5 +983,5 @@
 %\end{figure*}
 \bibliographystyle{abbrv}
 \bibliography{zotero,paper}
-\listoftodos
+%\listoftodos
 \end{document}
diff --git a/talk/vmil2012/tool/build_tables.py b/talk/vmil2012/tool/build_tables.py
--- a/talk/vmil2012/tool/build_tables.py
+++ b/talk/vmil2012/tool/build_tables.py
@@ -26,22 +26,40 @@
 
     table = []
     head = ['Benchmark',
-            'Failing guards',
-            'Over %d failures' % BRIDGE_THRESHOLD]
+            'Failing',
+            '> %d failures' % BRIDGE_THRESHOLD,
+            '50\% of failures']
 
     for bench, info in failures.iteritems():
-        total = failures[bench]['nguards']
+        total = info['nguards']
         total_failures = len(info['results'])
         bridges = len([k for k,v in info['results'].iteritems() \
                                             if v > BRIDGE_THRESHOLD])
         res = [bench.replace('_', '\\_'),
                 "%.1f\\%%" % (100 * total_failures/total),
                 "%.1f\\%%" % (100 * bridges/total),
+                "%.3f\\%%"  % (100 * we_are_50_percent(info)),
         ]
         table.append(res)
     output = render_table(template, head, sorted(table))
     write_table(output, texfile)
 
+def we_are_50_percent(info):
+    total_guards = info['nguards']
+    failure_counts = info['results'].values()
+    print failure_counts
+    failure_counts.sort()
+    print failure_counts
+    failure_counts.reverse()
+    print failure_counts
+
+    total_failures = sum(failure_counts)
+    current_sum = 0
+    for i, f in enumerate(failure_counts):
+        current_sum += f
+        if current_sum > total_failures * 0.50:
+            return (i + 1)/total_guards
+    return -1
 
 def build_resume_data_table(csvfiles, texfile, template):
     assert len(csvfiles) == 1
diff --git a/talk/vmil2012/tool/table_template.tex b/talk/vmil2012/tool/table_template.tex
--- a/talk/vmil2012/tool/table_template.tex
+++ b/talk/vmil2012/tool/table_template.tex
@@ -3,7 +3,7 @@
     \begin{tabular}{ |l{% for c in head %} {% if not loop.first %} |r {% endif %} {% endfor %} }
     \hline
     {% for col in head %}
-        \textbf{ {{col}} }
+        \textbf{ {{col|safe}} }
         {% if not forloop.last %}
            &
         {% endif %}
diff --git a/talk/vmil2012/zotero.bib b/talk/vmil2012/zotero.bib
--- a/talk/vmil2012/zotero.bib
+++ b/talk/vmil2012/zotero.bib
@@ -139,7 +139,7 @@
 	abstract = {The dynamic and reflective features of programming languages are powerful constructs that programmers often mention as extremely useful. However, the ability to modify a program at runtime can be both a boon-in terms of flexibility-, and a curse-in terms of tool support. For instance, usage of these features hampers the design of type systems, the accuracy of static analysis techniques, or the introduction of optimizations by compilers. In this paper, we perform an empirical study of a large Smalltalk codebase- often regarded as the poster-child in terms of availability of these features-, in order to assess how much these features are actually used in practice, whether some are used more than others, and in which kinds of projects. These results are useful to make informed decisions about which features to consider when designing language extensions or tool support.},
 	booktitle = {Proceedings of the 8th Working Conference on Mining Software Repositories},
 	publisher = {{ACM}},
-	author = {Calla&#250;, Oscar and Robbes, Romain and Tanter, &#201;ric and R&#246;thlisberger, David},
+	author = {Calla&#250;, Oscar and Robbes, Romain and Tanter, {\'{E}} and R&#246;thlisberger, David},
 	year = {2011},
 	keywords = {dynamic languages, smalltalk, static analysis},
 	pages = {23&#8211;32}
@@ -271,4 +271,4 @@
 	year = {1994},
 	keywords = {interactivity, recompilation, self},
 	pages = {229--243}
-}
\ No newline at end of file
+}


More information about the pypy-commit mailing list