Commits

Hakan Ardo committed 05aecd8 Merge

merge

  • Participants
  • Parent commits 8cd8987, 5791a9b

Comments (0)

Files changed (8)

talk/googlezurich2012/Makefile

+# you can find rst2beamer.py here:
+# http://codespeak.net/svn/user/antocuni/bin/rst2beamer.py
+
+# WARNING: to work, it needs this patch for docutils
+# https://sourceforge.net/tracker/?func=detail&atid=422032&aid=1459707&group_id=38414
+
+talk.pdf: talk.rst author.latex title.latex stylesheet.latex
+	rst2beamer.py --stylesheet=stylesheet.latex --documentoptions=14pt talk.rst talk.latex || exit
+	sed 's/\\date{}/\\input{author.latex}/' -i talk.latex || exit
+	sed 's/\\maketitle/\\input{title.latex}/' -i talk.latex || exit
+	pdflatex talk.latex  || exit
+
+view: talk.pdf
+	evince talk.pdf &
+
+xpdf: talk.pdf
+	xpdf talk.pdf &

talk/googlezurich2012/author.latex

+\definecolor{rrblitbackground}{rgb}{0.0, 0.0, 0.0}
+
+\title[PyPy in Production]{PyPy}
+\author[Armin Rigo]
+{Armin Rigo}
+
+\institute{Google 2012}
+\date{September 12, 2012}

talk/googlezurich2012/beamerdefs.txt

+.. colors
+.. ===========================
+
+.. role:: green
+.. role:: red
+
+
+.. general useful commands
+.. ===========================
+
+.. |pause| raw:: latex
+
+   \pause
+
+.. |small| raw:: latex
+
+   {\small
+
+.. |end_small| raw:: latex
+
+   }
+
+.. |scriptsize| raw:: latex
+
+   {\scriptsize
+
+.. |end_scriptsize| raw:: latex
+
+   }
+
+.. |strike<| raw:: latex
+
+   \sout{
+
+.. closed bracket
+.. ===========================
+
+.. |>| raw:: latex
+
+   }
+
+
+.. example block
+.. ===========================
+
+.. |example<| raw:: latex
+
+   \begin{exampleblock}{
+
+
+.. |end_example| raw:: latex
+
+   \end{exampleblock}
+
+
+
+.. alert block
+.. ===========================
+
+.. |alert<| raw:: latex
+
+   \begin{alertblock}{
+
+
+.. |end_alert| raw:: latex
+
+   \end{alertblock}
+
+
+
+.. columns
+.. ===========================
+
+.. |column1| raw:: latex
+
+   \begin{columns}
+      \begin{column}{0.45\textwidth}
+
+.. |column2| raw:: latex
+
+      \end{column}
+      \begin{column}{0.45\textwidth}
+
+
+.. |end_columns| raw:: latex
+
+      \end{column}
+   \end{columns}
+
+
+
+.. |snake| image:: ../img/py-web-new.png
+           :scale: 15%
+           
+
+
+.. nested blocks
+.. ===========================
+
+.. |nested| raw:: latex
+
+   \begin{columns}
+      \begin{column}{0.85\textwidth}
+
+.. |end_nested| raw:: latex
+
+      \end{column}
+   \end{columns}

talk/googlezurich2012/standards.png

Added
New image

talk/googlezurich2012/stylesheet.latex

+\usepackage{ulem}
+\usetheme{Boadilla}
+\usecolortheme{whale}
+\setbeamercovered{transparent}
+\setbeamertemplate{navigation symbols}{}
+
+\definecolor{darkgreen}{rgb}{0, 0.5, 0.0}
+\newcommand{\docutilsrolegreen}[1]{\color{darkgreen}#1\normalcolor}
+\newcommand{\docutilsrolered}[1]{\color{red}#1\normalcolor}
+
+\newcommand{\green}[1]{\color{darkgreen}#1\normalcolor}
+\newcommand{\red}[1]{\color{red}#1\normalcolor}

talk/googlezurich2012/talk.rst

+.. include:: beamerdefs.txt
+
+============================================================
+PyPy
+============================================================
+
+
+PyPy is...
+--------------------------
+
+* Another Python interpreter
+
+* with a JIT compiler
+
+
+PyPy was...
+-------------------
+
+* Around since 2003
+
+* (advertised as) production ready since December 2010
+
+  - release 1.4
+
+* Funding
+
+  - EU FP6 programme
+
+  - Eurostars programme
+
+  - donations
+
+  - ...
+
+
+PyPy 1.9: current status
+------------------------
+
+* Faster
+
+  - **1.7x** than 1.5 (Summer 2011)
+
+  - **2.2x** than 1.4 (December 2010)
+
+  - **5.5x** than CPython
+
+* Implements Python 2.7.3
+
+* Many more "PyPy-friendly" programs than before
+
+* Packaging
+
+  - |scriptsize| Debian, Ubuntu, Fedora, Homebrew, Gentoo, ArchLinux, ... |end_scriptsize|
+
+  - |scriptsize| Windows (32bit only), OS X |end_scriptsize|
+
+* C extension compatibility
+
+  - runs (big part of) **PyOpenSSL** and **lxml**
+
+
+PyPy organization
+-----------------
+
+* Part of SFC -- Software Freedom Conservancy
+
+  - Bradley successfully fighting U.S. bureaucracy
+
+  - we are happy about it
+
+
+* Funding model
+
+  - py3k, numpy, STM
+
+  - more than 100'000$ in donations
+
+  - from individuals, large companies and the PSF
+
+
+PyPy's JIT compiler
+-------------------
+
+* Removes abstraction
+
+* Almost never gives up
+
+* x86-32, x86-64, ARMv7, (POWER64)
+
+* (Works with other languages)
+
+
+Real world applications
+-----------------------
+
+* Positive feedback
+
+* http://speed.pypy.org/
+
+* demo
+
+
+py3k
+------------------------
+
+* ``py3k`` branch in mercurial
+
+  - developed in parallel
+
+  - Python 3 written in Python 2
+
+* Focus on correctness
+
+* Dropped some interpreter optimizations for now
+
+* First 90% done, remaining 90% not done
+
+* Majority of the funds by Google
+
+
+NumPy
+-----
+
+* progress going slowly
+
+* multi dimensional arrays, broadcasting, fancy indexing
+
+* all dtypes, except complex, strings and objects
+
+* good results for performance
+
+
+STM
+---------------------------
+
+* Software Transactional Memory
+
+* "Remove the GIL"
+
+* But also, new models (better than threads)
+
+* demo
+
+
+Calling C
+---------
+
+.. image:: standards.png
+   :scale: 60%
+   :align: center
+
+Calling C landscape
+-------------------
+
+* CPython C extensions
+
+* SWIG, SIP, wrapper generators
+
+* ctypes
+
+* Cython
+
+* CFFI (our new thing)
+
+CFFI
+----------
+
+|scriptsize|
+|example<| Example |>|
+
+  .. sourcecode:: pycon
+
+   >>> from cffi import FFI
+   >>> ffi = FFI()
+   >>> ffi.cdef("""
+   ...     int printf(const char *format, ...);
+   ... """)
+   >>> C = ffi.dlopen(None)
+   >>> arg = ffi.new("char[]", "world")
+   >>> C.printf("hi there, %s!\n", arg)
+   hi there, world!
+
+|end_example|
+|end_scriptsize|
+
+CFFI
+----
+
+* Many more examples
+
+* Including macro calls and most subtleties of C
+
+* http://cffi.readthedocs.org
+
+
+Conclusion
+----------
+
+* Try out PyPy on real code
+
+* http://pypy.org/
+
+* Thank you!

talk/googlezurich2012/title.latex

+\begin{titlepage}
+\begin{figure}[h]
+\includegraphics[width=60px]{../img/py-web-new.png}
+\end{figure}
+\end{titlepage}

talk/stm2012/stmimpl.rst

 
     def PossiblyUpdateChain(G, R, R_Container, FieldName):
         if R != G and Rarely():
-            # compress the chain
-            while G->h_revision != R:
-                G_next = G->h_revision
-                G->h_revision = R
-                G = G_next
+            # compress the chain one step (cannot compress the whole chain!)
+            G->h_revision = R
             # update the original field
             R_Container->FieldName = R
 
 the modified values.  It works because the original and each modified
 value are all interchangeable as far as correctness goes.
 
+However, note that if the chain is longer than one item, we cannot fix
+the whole chain -- we can only fix the first item.  The issue is that we
+cannot at this point reliably walk the chain again until we reach ``R``,
+precisely because *another* thread might be fixing the *same* chain in
+such a way that ``R`` is then skipped.
+
 ``Rarely`` uses a thread-local counter to return True only rarely.  We
 do the above update only rarely, rather than always, although it would
 naively seem that doing the update always is a good idea.  The problem