Author: Matti Picus <[email protected]> Branch: extradoc Changeset: r5640:e8ac394f3c2e Date: 2016-04-28 11:51 +0300 http://bitbucket.org/pypy/extradoc/changeset/e8ac394f3c2e/
Log: update diff --git a/talk/pycon-il-2016/Makefile b/talk/pycon-il-2016/Makefile --- a/talk/pycon-il-2016/Makefile +++ b/talk/pycon-il-2016/Makefile @@ -1,13 +1,10 @@ # pip install rst2beamer -# 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.latex + pdflatex talk.latex -talk.pdf: talk.tex - pdflatex talk.tex - -talk.tex: talk.rst author.latex stylesheet.latex - rst2beamer --stylesheet=stylesheet.latex --documentoptions=14pt --input-encoding=utf8 --output-encoding=utf8 $< > talk.latex +talk.latex: talk.rst author.latex stylesheet.latex *.png + rst2beamer --stylesheet=stylesheet.latex --documentoptions=12pt --input-encoding=utf8 --output-encoding=utf8 $< > talk.latex sed 's/\\date{}/\\input{author.latex}/' -i talk.latex || exit diff --git a/talk/pycon-il-2016/ndarray.png b/talk/pycon-il-2016/ndarray.png new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..30c7c55cd501c36f9d322596b3a481c0de63a9fc GIT binary patch [cut] diff --git a/talk/pycon-il-2016/speed.png b/talk/pycon-il-2016/speed.png index 63b771ce59358bbcb28efbba84a43f03328b4554..d4a72a103291365508bc5813d04a6acbc1d9f402 GIT binary patch [cut] diff --git a/talk/pycon-il-2016/talk.pdf b/talk/pycon-il-2016/talk.pdf index 27f0b7ce06dde8f973e1eb3c65f491c87a2d1604..51c1443ef77403e7affefca9ed3b4d748cf0c7c2 GIT binary patch [cut] diff --git a/talk/pycon-il-2016/talk.rst b/talk/pycon-il-2016/talk.rst --- a/talk/pycon-il-2016/talk.rst +++ b/talk/pycon-il-2016/talk.rst @@ -4,54 +4,18 @@ PyPy 2016 ========= -Introduction ------------- +Python means four things: +------------------------- Python is -* A syntax or two +* A syntax or six `(2 * 3 = 6)` -* An interpreter +* An interpreter to run code written in the syntax * A set of standard libraries shipped with the interpreter -* A vibrant number of communitis that shares code - -PyPy ----- - -* PyPy is an interpreter written in RPython - -* Speed is one of its main advantages - -* Compatible (mostly) - -Speed ------ - -.. image:: speed.png - :scale: 50% - :align: center - -How ? ------ - -* Tracing Just-In-Time compiler - -* Optimizes loops - -* Traces one iteration of a loop - -* Produces a linear trace of execution - -* Inlines almost everything - -* The trace is then optimized and compiled - -* Removes overhead - -Prove It --------- +* A vibrant number of communities that share code Techniques to achieve performant Python --------------------------------------- @@ -70,33 +34,100 @@ * Use PyPy +PyPy +---- + +* PyPy is an interpreter written in RPython + +* It ships with the standard library + +* Speed is one of its main advantages + +* Compatible (mostly) via pip install + +* Not the only alternative interpreter + +Speed (Applause) +---------------- + +.. image:: speed.png + :scale: 50% + :align: center + +Speed continued +--------------- + +* Benchmarking, statistics, politics + +* Did I mention warmup time? + +How ? +----- + +* Tracing Just-In-Time compiler + +* Optimizes loops + +* Traces one iteration of a loop + +* Produces a linear trace of execution + +* The trace is then **optimized** and compiled + +Why is this fast? +----------------- + +* Inlining + +* Promotion + +* Unrolling + +* Strategies + + - Convert sequences to arrays + + - Vectorization + +Prove It +-------- + +* profiling + +* jitviewer + Why not PyPy? ------------- -* Python III +* Python and the community * Third-party library support -PyPy and C (1/2) +* No easy packaging (like Winpython or Anaconda) + + - Opportunity??? + +PyPy and C (1/3) ---------------- -* PyPy and CFFI +* PyPy and CFFI (Armin Rigo, Maciej Fijałkowski) -* CFFI is the easiest tool to I've used so far - -* Very fast on PyPy, fast enough on CPython - -* Used by NumPyPy +* CFFI is easy, just massage the headers and that's it * Use CFFI to call python from C - This means you can create your own C API in pure Python ! -PyPy and C (2/2) +PyPy and C (2/3) ---------------- * CFFI enables embedded Python (and PyPy) in a C application (uWSGI) +* Very fast on PyPy, fast enough on CPython + +PyPy and C (3/3) +---------------- + * What about C-API (glad you asked) * Actively worked on right now @@ -106,6 +137,8 @@ * Leaks way too many implementation details (refcounting, PyObject structure fields) +* C allows you to cheat (private, read-only) + * Makes it hard to improve Python while supporting 100% of the API * PyPy 5.0 introduced a major rewrite @@ -117,7 +150,7 @@ * https://bitbucket.org/pypy/numpy + pypy -* I have been working on it since 2011 +* I have been working on it since 2011, together with many others * Replaces ndarray, umath with builtin modules @@ -126,11 +159,21 @@ * Most of numpy is there: object dtypes, ufuncs * linalg, fft, random all via cffi +* Should be as fast as Numpy, faster for smaller arrays NumPyPy performance ------------------- -* Should be as fast as Numpy, faster for smaller arrays +* From http://rpubs.com/mikefc/60129 + +.. image:: ndarray.png + :scale: 35% + :align: center + +* numpypy in blue, numpy in red + +NumPyPy future +-------------- * Lazy evaluation ? @@ -141,7 +184,7 @@ * https://github.com/rguillebert/pymetabiosis -* Work in progress +* Proof of concept (Romain Guillebert) * Allows you to use any CPython module on PyPy (scipy for example) @@ -226,12 +269,12 @@ * Native numpy (tweaked) passes 90% of tests -* How to leverage the JIT? +* How to leverage the JIT and NumPyPy? Why this makes sense -------------------- -* Advantages and disadvantages of RPython +* Advantages of RPython * Advantages of a JIT (vectorization) @@ -242,11 +285,21 @@ * Get PyPy at pypy.org (or from your favorite distribution) -* Try it +* Use it in a virtualenv -* Give us feedback (good or bad) +* Give us feedback (good or bad) #pypy on IRC -Thank You +Thank You --------- -Questions ? +Questions ? Examples: + +* What about this other interpreter I heard of? + +* How can I get involved? + +* What about commercial involvement? + +* How can I get support? + +* What about Python 3.5? _______________________________________________ pypy-commit mailing list [email protected] https://mail.python.org/mailman/listinfo/pypy-commit
