May 2017
Intermediate to advanced
270 pages
6h 18m
English
Now that we have successfully set up the PyPy installation, we can go ahead and run our particle simulator. As a first step, we will time the particle simulator from Chapter 1, Benchmarking and Profiling, on the standard Python interpreter. If the virtual environment is still active, you can issue the command deactivate to exit the environment. We can confirm that the Python interpreter is the standard one by using the python -V command:
(my-pypy-env) $ deactivate$ python -VPython 3.5.2 :: Continuum Analytics, Inc.
At this point, we can time our code using the timeit command-line interface:
$ python -m timeit --setup "from simul import benchmark" "benchmark()"10 loops, best of 3: 886 msec per loop
Read now
Unlock full access