Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Timing results for the various implementations of Project Euler problem 14. Nico's is fastest.
$ time python -t -O problem14_nico.py
('The starting position generating the longest sequence is', 837799)
real 0m6.914s
user 0m6.645s
sys 0m0.202s
$ time python -t -O main_timer.py problem14
args= ['main_timer.py', 'problem14']
from problem14 import main
longest= 525 generated from 837799
answer= 837799
tstart= 2.330000e+02 tend= 2.861000e+04
runtime(CPU milliseconds)= 28377.0
real 0m28.690s
user 0m28.501s
sys 0m0.140s
$ time python -t -O main_timer.py problem14_nocache
args= ['main_timer.py', 'problem14_nocache']
from problem14_nocache import main
longest= 525 generated from 837799
answer= 837799
tstart= 2.020000e+02 tend= 1.778560e+05
runtime(CPU milliseconds)= 177654.0
real 3m1.165s
user 2m57.638s
sys 0m0.265s
$ time python -t -O main_timer.py problem14_bigger
args= ['main_timer.py', 'problem14_bigger']
from problem14_bigger import main
longest= 525 generated from 837799
answer= 837799
tstart= 2.490000e+02 tend= 1.698800e+04
runtime(CPU milliseconds)= 16739.0
real 0m19.574s
user 0m16.863s
sys 0m0.186s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment