From: W. Trevor King Date: Tue, 7 Dec 2010 18:08:36 +0000 (-0500) Subject: Add profiling hints to README. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=aa32ffc050cbe24d45f07d2654f9690fd24369d5;p=poker.git Add profiling hints to README. Currently most of the time comes from deciding which 5 card subset to use for scoring: Tue Dec 7 13:05:34 2010 profile 775071 function calls (773802 primitive calls) in 30.534 CPU seconds Ordered by: cumulative time List reduced from 240 to 20 due to restriction <20> ncalls tottime percall cumtime percall filename:lineno(function) 1 0.000 0.000 30.534 30.534 :1() 1 0.007 0.007 30.533 30.533 {execfile} 1 0.003 0.003 30.526 30.526 ./pbot.py:4() 1 0.034 0.034 30.273 30.273 ./pbot.py:10(run) 340 0.036 0.000 28.194 0.083 ./table.py:307(play_round) 340 0.164 0.000 23.889 0.070 ./table.py:331(deal) 766 0.026 0.000 23.434 0.031 ./deck.py:209(__init__) 766 1.232 0.002 23.409 0.031 ./deck.py:216(high_hand) 19089 1.068 0.000 22.004 0.001 ./deck.py:172(score) 16096 6.800 0.000 16.844 0.001 ./deck.py:164(_type_index) 340 0.118 0.000 3.835 0.011 ./table.py:377(betting_round) ... --- diff --git a/README b/README index fd9981a..83c157f 100644 --- a/README +++ b/README @@ -5,3 +5,8 @@ Multiplayer poker game. Example usage: Run internal tests with nosetests --with-doctest --doctest-test *.py + +Profile with + + python -m cProfile -o profile ./pbot.py a,bots/p1.py b,bots/p1.py x,bots/p2.py y,bots/p2.py + python -c 'import pstats; p = pstats.Stats("profile"); p.sort_stats("cumulative").print_stats(20)'