Skip to content

Commit 96521d2

Browse files
committed
Add benchmarks
1 parent 87bb636 commit 96521d2

1 file changed

Lines changed: 24 additions & 2 deletions

File tree

docs/scenarios/speed.rst

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,28 @@ Speed
33

44
CPython, the most commonly used implementation of Python, is slow for CPU bound tasks. `PyPy`_ is fast.
55

6-
.. todo:: Fill in stub for Speed comparisons
6+
Using a slightly modified version of `David Beazleys`_ CPU bound test code(added loop for multiple tests), you can see the difference between CPython and PyPy's processing.
7+
8+
.. pypy::
9+
$ ./pypy -V
10+
Python 2.7.1 (7773f8fc4223, Nov 18 2011, 18:47:10)
11+
[PyPy 1.7.0 with GCC 4.4.3]
12+
$ ./pypy measure2.py
13+
0.0683999061584
14+
0.0483210086823
15+
0.0388588905334
16+
0.0440690517426
17+
0.0695300102234
18+
19+
.. python::
20+
$ ./python -V
21+
Python 2.7.1
22+
$ ./python measure2.py
23+
1.06774401665
24+
1.45412397385
25+
1.51485204697
26+
1.54693889618
27+
1.60109114647
728

829
Context
930
:::::::
@@ -67,4 +88,5 @@ Multiprocessing
6788
.. _`The GIL`: http://wiki.python.org/moin/GlobalInterpreterLock
6889
.. _`guide`: http://www.dabeaz.com/python/UnderstandingGIL.pdf
6990
.. _`New GIL`: http://www.dabeaz.com/python/NewGIL.pdf
70-
.. _`Special care`: http://docs.python.org/c-api/init.html#threads
91+
.. _`Special care`: http://docs.python.org/c-api/init.html#threads
92+
.. _`David Beazleys`: http://www.dabeaz.com/GIL/gilvis/measure2.py

0 commit comments

Comments
 (0)