Skip to content

Instantly share code, notes, and snippets.

@ipmb
Created August 21, 2015 22:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ipmb/be4af9e95c811a263059 to your computer and use it in GitHub Desktop.
Save ipmb/be4af9e95c811a263059 to your computer and use it in GitHub Desktop.
PyPy vs. CPython comparison

Test machine: OS X 10.10.5 w/ 2.4 GHz Intel Core i5

Server:

$ gunicorn -w2 botbot.wsgi:application

Client:

$ siege -c2 -t2m http://localhost:8000/freenode/django/2015-04-01/

CPython

$ python --version && gunicorn --version
Python 2.7.10
gunicorn (version 19.3.0)

Transactions:		         215 hits
Availability:		      100.00 %
Elapsed time:		      119.31 secs
Data transferred:	       49.29 MB
Response time:		        0.62 secs
Transaction rate:	        1.80 trans/sec
Throughput:		        0.41 MB/sec
Concurrency:		        1.11
Successful transactions:         215
Failed transactions:	           0
Longest transaction:	        1.05
Shortest transaction:	        0.51

PyPy

$ python --version && gunicorn --version
Python 2.7.9 (295ee98b69288471b0fcf2e0ede82ce5209eb90b, Jun 02 2015, 18:26:45)
[PyPy 2.6.0 with GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)]
gunicorn (version 19.3.0)

Transactions:		         153 hits
Availability:		      100.00 %
Elapsed time:		      119.03 secs
Data transferred:	       32.78 MB
Response time:		        1.10 secs
Transaction rate:	        1.29 trans/sec
Throughput:		        0.28 MB/sec
Concurrency:		        1.42
Successful transactions:         153
Failed transactions:	           0
Longest transaction:	        3.43
Shortest transaction:	        0.78
@ipmb
Copy link
Author

ipmb commented Aug 22, 2015

Results with more requests to warm up JIT:

$ siege -c2 -r2000 http://localhost:8000/freenode/django/2015-04-01/

pypy bench

The blip in the middle of the CPython test was me opening up a browser accidentally during the test. Full results: https://docs.google.com/spreadsheets/d/18hsX3y8KQNJtWZTKsdKMRtVfVyvpAajXBGYSuWXvess/edit?usp=sharing

The CPython test finished in ~35m. PyPy took ~45m.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment