Python Programming Contest
python at rcn.com
Wed Jul 20 07:41:01 CEST 2005
> I'm doing to judge the solutions based on execution speed. It sucks but
> that is the easiest important consideration to objectively measure.
. . .
> I'm always looking for feedback, so let me know what you think or if you
> have any ideas for future problems.
I'm curious about the stability of your timing setup. If you run your
own version of fly.py several times with the same starting seed, how
much variation do you see between runs?
When I tried the provided setup, it was highly variable. To get useful
measurements, I needed another timing framework:
setup = """
from fly import fly
params = 
for i in xrange(100):
schedule = fly_test.generate_schedule()
from_, to = fly_test.pick_cities(schedule)
params.append( (from_, to, schedule) )
stmt = """
for p in params:
print min(timeit.Timer(stmt, setup).repeat(5, 3))
More information about the Python-list