Support unavailable
Please try again later

PyPy hands-on

by Armin Rigo - Antonio Cuni for EuroPython 2011

The session is divided into two parts, of roughly 2 hours each. People who are interested only in the first part, can leave the session after it. However, the first part is a prerequisite for the second one, thus people are not advised to join in the middle of the session.

The session is meant to be highly interactive. People are invited to bring their own laptop and try things by themselves.

Part 1: Run your application under PyPy

This tutorial is targeted to Python users who want to run their favorite Python application under PyPy, and exploit the most of it. The following topics will be covered:

- how to fix/avoid CPython implementation details (e.g., refcounting)

- general overview of how the PyPy JIT works

- how to optimize your program for the PyPy JIT

- how to view and interpret the traces produced by the JIT

- how to tweak the parameters of the JIT and the GC

- how to use existing CPython C extensions on PyPy, and fix them if necessary

Part 2: Write your own interpreter with PyPy

PyPy is not only a Python interpreter, but also a toolchain to implement dynamic languages. This tutorial is targeted to people who want to implement their own programming languages, or who simply want to know more about how the PyPy JIT works internally.

The students will be given the source code for a toy language implemented in RPython. They will learn:

- how to translate it to C using the PyPy translation toolchain

- what are the "hints" needed by the JIT generator, and how to place them

Then, they will be challenged to add the proper hints to the toy interpreter, to get the best result with the JIT.

THINGS TO DO BEFORE THE TRAINING

You are encouraged to bring your laptop to the training session.

Make sure that the following prerequisites are met:

If you intend to follow also the second part ("Write your own interpreter with PyPy"), you need to make sure you have a working developing environment

Video

Do you have some questions on this talk? Leave a comment to the speaker!

New comment


Language
EN
Duration
240 minutes (inc Q&A)
Our Sponsors
Spotify
Python Experts
SSL Matrix
Wanna sponsor?