Commits

Armin Rigo committed 383391c

My talk, mostly copied from googlezurich2012.

Comments (0)

Files changed (8)

talk/pyconza2012/stm-talk/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/pyconza2012/stm-talk/author.latex

+\definecolor{rrblitbackground}{rgb}{0.0, 0.0, 0.0}
+
+\title[PyPy in Production]{PyPy}
+\author[Armin Rigo]
+{Armin Rigo}
+
+\institute{PyCon ZA 2012}
+\date{October 4, 2012}

talk/pyconza2012/stm-talk/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/pyconza2012/stm-talk/demo1.py

+
+class Number(object):
+
+   def __init__(self, num):
+       self.num = num
+
+   def __add__(self, other):
+       return Number(self.num + other.num)
+
+   def __invert__(self):
+       return Number(~self.num)
+
+def foo(n):
+    total = Number(0)
+    for i in range(n):
+        total += Number(i)
+        total += ~ Number(i)
+    return total.num
+
Add a comment to this file

talk/pyconza2012/stm-talk/standards.png

Added
New image

talk/pyconza2012/stm-talk/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/pyconza2012/stm-talk/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/
+
+
+
+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)
+
+
+
+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
+
+
+STM
+---
+
+
+Conclusion
+----------
+
+* Try out PyPy on real code
+
+* http://pypy.org/
+
+* Thank you!

talk/pyconza2012/stm-talk/title.latex

+\begin{titlepage}
+\begin{figure}[h]
+\includegraphics[width=60px]{../../img/py-web-new.png}
+\end{figure}
+\end{titlepage}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.