Benchmarking Python Interpreters : Measuring Performance of CPython, Cython, Jython and PyPy

University essay from KTH/Skolan för datavetenskap och kommunikation (CSC)

Abstract: For the Python programming language there are several different interpreters and implementations. In this thesis project the performance regarding execution time is evaluated for four of these; CPython, Cython, Jython and PyPy. The performance was measured in a test suite, created during the project, comprised of tests for Python dictionaries, lists, tuples, generators and objects. Each test was run with both integers and objects as test data with varying problem size. Each test was implemented using Python code. For Cython and Jython separate versions of the test were also implemented which contained syntax and data types specific for that interpreter. The results showed that Jython and PyPy were fastest for a majority of the tests when running code with only Python syntax and data types. Cython uses the Python C/API and is therefore dependent on CPython. The performance of Cython was therefore often similar to CPython. Cython did perform better on some of the tests when using Cython syntax and data types, as it could therefore decrease its reliance to CPython. Each interpreter was able to perform fastest on at least one test, showing that there is not an interpreter that is best for all problems.

  AT THIS PAGE YOU CAN DOWNLOAD THE WHOLE ESSAY. (follow the link to the next page)