Created
July 27, 2011 13:16
-
-
Save jacobh/1109333 to your computer and use it in GitHub Desktop.
PyPy & CPython speeds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jacob@debian:~/Projects/Euler$ time python 005.py | |
smallest number: 232792560 | |
real 5m24.439s | |
user 5m24.200s | |
sys 0m0.220s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jacob@debian:~/Projects/Euler$ time pypy 005.py | |
smallest number: 232792560 | |
real 0m8.739s | |
user 0m8.693s | |
sys 0m0.044s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n = 20 | |
i = 1 | |
t = n | |
while(t > 1): | |
if(i/t == i/float(t)): | |
t -= 1 | |
if(i/t != i/float(t)): | |
t = n | |
i += 1 | |
print 'smallest number: ', i |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment