PageRenderTime 27ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/talk/djangocon.eu2011/talk.rst

https://bitbucket.org/pypy/extradoc/
ReStructuredText | 201 lines | 143 code | 58 blank | 0 comment | 0 complexity | d3b03c2647d8723b77b903aea910f16c MD5 | raw file
  1. =====================================
  2. Django and PyPy: performant is a word
  3. =====================================
  4. Me
  5. ---
  6. * Django and PyPy core developer
  7. * I like making **your** code faster
  8. * Working at Quora making their codebase run on PyPy, fast.
  9. What is Django?
  10. ---------------
  11. * Anyone here know?
  12. What is PyPy?
  13. -------------
  14. * An implementation of Python 2.7.1
  15. * A very fast implementation
  16. * A very compliant implementation
  17. What is PyPy? (2)
  18. -----------------
  19. * Python written in Python
  20. * Open source (MIT licensed)
  21. * 8 years old
  22. * Over 150,000 lines of test code (that's more than all of Django)
  23. * A successor to Psyco
  24. Fast
  25. ----
  26. * Faster than CPython on almost every benchmark we have.
  27. * http://speed.pypy.org/
  28. * A very actively developed project: http://bit.ly/pypy-django-bench
  29. World's shortest introduction to JITing
  30. ---------------------------------------
  31. * Run interpreter
  32. * Find frequently executed loops
  33. * Turn those loops into efficient assembler, by specializing for the types
  34. of variables and other things.
  35. Case studies
  36. ------------
  37. * Production ready
  38. * Real people are using this to speed up their apps.
  39. LWN.net
  40. -------
  41. * Parse the output of ``git log`` and generate data/reports
  42. * CPython: 63 seconds
  43. * PyPy: 21 seconds
  44. Some guy on IRC
  45. ---------------
  46. * Query PostgreSQL and generate reports.
  47. * CPython: 2 minutes
  48. * PyPy: 8 seconds
  49. Why isn't everyone using PyPy?
  50. ------------------------------
  51. * C extensions
  52. * C-API tightly coupled to CPython implementation details
  53. Solutions
  54. ---------
  55. * CPyExt
  56. * Pure Python/``ctypes``
  57. * Cython (GSOC)
  58. But web apps are I/O bound...
  59. -----------------------------
  60. * Eh, maybe they should be, but they often aren't.
  61. The Wild Wild Web (WWW for short)
  62. ---------------------------------
  63. * To run a Django site you need a handful of things
  64. * Web server
  65. * Database
  66. * Random other libraries (``PIL``, ``lxml``, etc.)
  67. Web server
  68. ----------
  69. * WSGI
  70. * Any pure Python server will do
  71. * I like ``gunicorn``, you can use whatever you like
  72. * *Not* ``mod_wsgi``
  73. Database
  74. --------
  75. * Use any database you like, so long as there's an adapter for it that works with both Django and PyPy!
  76. SQLite
  77. ------
  78. * Standard library, just works!
  79. PostgreSQL
  80. ----------
  81. * RPython ``psycopg2`` compatible lib, requires compiling your own PyPy
  82. * ``pg8000`` and tons of other random libraries, Django doesn't work with them, but if they're pure Python they'll work with other stuff (e.g. SQLAlchemy)
  83. MySQL
  84. -----
  85. * (various expletives censored)
  86. * Nothing that works with Django ATM
  87. * I'm working on a ``ctypes`` based MySQLdb dropin replacement, hopefully open source soonish.
  88. Oracle
  89. ------
  90. * We have an RPython ``cx_Oracle``
  91. * I know nothing about its status
  92. Other databases
  93. ---------------
  94. * There are other databases?
  95. * Uhh, talk to me later?
  96. Random other libs
  97. -----------------
  98. * ``PIL`` - works under CPyExt
  99. * ``lxml`` - doesn't work :(
  100. * Others - how should I know? Others isn't very specific.
  101. Benchmarking!
  102. -------------
  103. * Lies, damned lies, and statistics!
  104. * And benchmarks
  105. * Ignore them, you need to test *your* app.
  106. * But if you need to convince your boss...
  107. Django template benchmark
  108. -------------------------
  109. * Part of the Unladen Swallow benchmark suite
  110. * PyPy 1.5: almost 10x faster than CPython
  111. * PyPy trunk: almost 12x faster
  112. * http://bit.ly/pypy-django-bench
  113. Rietveld benchmark
  114. ------------------
  115. * Another part of the Unladen Swallow benchmark suite
  116. * PyPy trunk: about 1.35x faster than CPython
  117. Tornado web app
  118. ---------------
  119. * 2x as many requests per second
  120. Memory
  121. ------
  122. * Mixed bag.
  123. * Some apps use more, some use less.
  124. * Benchmark your own app.
  125. PyPy
  126. ----
  127. * A better platform for developing Python itself
  128. * A faster Python for your apps
  129. Recruiting
  130. ----------
  131. * We could use some developers/designer to help with our performance tools.
  132. * We have a cool webbased profiling/analyses tool.
  133. * Flask/Jinja/jQuery (sorry)
  134. * Contributors wanted, no compiler experience needed!
  135. * http://bit.ly/pypy-recruiting
  136. Questions?
  137. ----------
  138. * http://alexgaynor.net/
  139. * http://pypy.org/
  140. * #pypy on irc.freenode.net
  141. * I want to make your apps faster, come talk to me!
  142. * Thank you!
  143. * Dank je wel!