I recently tried to run an Project Euler problem in python. It was my belief that it would do something like 100^5 steps.
After seeing that my solution wat taking too long (it is supposed to run in under a minute) I asked myself if any python program that ran this many steps would be viable (under a minute)
so, I designed a foolish little test
def fun():
l=range(1,100)
for x in l:
for y in l:
for k in l:
for n in l:
for h in l:
s=1
>>> t = timeit.Timer('demorado.fun()','import demorado')
>>> t.timeit(1)
1202.484529018402
>>>
does is make sense ? Does it prove that any program with this many steps (in this case, I guess there are 2*(100^5)) always demands some 20 minutes ?
For python it’s probably a good estimate. Using numpy or C++ extensions might speed up your Project Euler code, but remember all problems on Project Euler are designed to be solvable in <1 min. It’s very unlikely you are required to run 100^5 operations in order to arrive at the correct solution. I’d try to approach the problem from a different angle if I were you.