[pypy-svn] r74425 - pypy/extradoc/talk/pycon-italy-2010/talk
antocuni at codespeak.net
antocuni at codespeak.net
Thu May 6 18:45:48 CEST 2010
Author: antocuni
Date: Thu May 6 18:45:46 2010
New Revision: 74425
Modified:
pypy/extradoc/talk/pycon-italy-2010/talk/talk.txt
Log:
add the slides about part 3
Modified: pypy/extradoc/talk/pycon-italy-2010/talk/talk.txt
==============================================================================
--- pypy/extradoc/talk/pycon-italy-2010/talk/talk.txt (original)
+++ pypy/extradoc/talk/pycon-italy-2010/talk/talk.txt Thu May 6 18:45:46 2010
@@ -39,8 +39,6 @@
- What's new and status update
-- Mandelbrot demo
-
What's new in PyPy 1.2
-----------------------
@@ -69,6 +67,20 @@
.. image:: pypy-vs-psyco.png
:scale: 35
+Speed: Demo
+-----------
+
+- Django application
+
+- Mandelbrot fractal
+
+ * fished randomly on the net :-)
+
+- Run both on CPython and PyPy
+
+ * django trunk!
+
+
What works on PyPy
-------------------
@@ -254,5 +266,129 @@
Part 3
------
-Demo explained
+How to use PyPy right now
+
+
+Mandelbrot demo
+---------------
+
+- Works purely on PyPy
+
+- Not always the case
+
+ * missing extension modules (cpyext mitigates the problem)
+
+ * libraries that rely on CPython details
+
+ * ...
+
+- clear performance-critical part
+
+
+CPython and PyPy side by side
+------------------------------
+
+- CPython: runs the main application
+
+- PyPy: subprocess, runs only the hotspots
+
+- How do they communicate?
+
+- execnet
+
+ * **The Ring of Python**, Holger Krekel, 9:00
+
+ * oups, too late :-)
+
+
+Rendering (1)
+---------------
+
+|example<| Mandelbrot |>|
+|small|
+::
+
+ def render(request):
+ w = int(request.GET.get('w', 320))
+ h = int(request.GET.get('h', 240))
+
+ from py_mandel import mandelbrot
+ img = mandelbrot(w, h)
+
+ return HttpResponse(img, content_type="image/bmp")
+
+|end_small|
+|end_example|
+
+
+Rendering (2)
+-------------
+
+|example<| Mandelbrot on PyPy |>|
+|small|
+::
+
+ def pypy_render(request):
+ w = int(request.GET.get('w', 320))
+ h = int(request.GET.get('h', 240))
+
+ channel = pypy.remote_exec("""
+ from py_mandel import mandelbrot
+ w, h = channel.receive()
+ img = mandelbrot(w, h)
+ channel.send(img)
+ """)
+ channel.send((w, h))
+ img = channel.receive()
+
+ return HttpResponse(img, content_type="image/bmp")
+
+|end_small|
+|end_example|
+
+execnet setup
+-------------
+
+|example<| At startup |>|
+|small|
+::
+
+ import execnet
+ mygroup = execnet.Group()
+ pypy = mygroup.makegateway("popen//python=pypy-c")
+ pypy.remote_exec("""
+ import sys
+ import os
+ os.chdir("mandelbrot")
+ sys.path.insert(0, '')
+ """)
+
+|end_small|
+|end_example|
+
+
+Demo
+----
+
+
+Benchmarks
+----------
+
+.. image:: demo-graph.pdf
+ :scale: 45
+
+
+Contact / Q&A
+--------------
+
+* Antonio Cuni: at http://merlinux.eu
+
+* Armin Rigo: arigo (at) tunes.org
+
+* Links:
+
+ - PyPy: http://www.pypy.org
+
+ - PyPy speed center: http://speed.pypy.org/
+ - Blog: http://morepypy.blogspot.com
More information about the Pypy-commit
mailing list