• About
  • Contact
  • What People Are Saying

A PyPy experiment

Mar16th
2012
Leave a Comment Written by Daniel Veazey

I really have no idea what PyPy is. All I know is that it is an implementation of Python written in Python (?) and that it runs faster than Python. For example, I tested the Monty Hall Problem that I wrote recently, and timed them. Here is the result:

[daniel@TimeMachine Python]$ time python2 monty_hall_switch.py
All choices were switched.
Wins: 66679
Losses: 33321
real 0m1.265s
user 0m1.243s
sys 0m0.023s
[daniel@TimeMachine Python]$ time pypy monty_hall_switch.py
All choices were switched.
Wins: 66853
Losses: 33147
real 0m0.594s
user 0m0.477s
sys 0m0.070s

So PyPy ran the program more than twice as fast as Python. Pretty neat, huh?

Be Sociable, Share!
  • Tweet

Related posts:

  1. The Monty Hall Problem
  2. pyvideo.org – Keynote: David Beazley on PyPy
  3. Installing packages from Arch User Repository
  4. Is Visual Basic really necessary?
  5. Introduction to writing card games in Python
Python    monty hall problem, pypy, Python
SHARE THIS Twitter Facebook Delicious StumbleUpon E-mail
← pyvideo.org – Keynote: David Beazley on PyPy
Introduction to writing card games in Python →

No Comments Yet

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Why you should leave a comment

1. I read all the comments.
2. I reply and answer every question.
3. I always click through to see the sites of commentators.
4. Because you can.
5. You become a participant instead of just an observer.

EvoLve theme by Theme4Press  •  Powered by WordPress Daniel Veazey
Things I find interesting