This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author thorben
Recipients thorben
Date 2008-09-10.07:25:59
SpamBayes Score 0.00082674786
Marked as misclassified No
Message-id <1221031562.14.0.495802396879.issue3766@psf.upfronthosting.co.za>
In-reply-to
Content
As promised, here is the profiler output for a Mac (thanks Stefan). The
problem does NOT occur here, which should help greatly in tracking down
the cause in the socket library. Anyone into this?

$ python runme.py
500 packets @ 2 tokens each (500 very short lists)
0.0814669132233
        14508 function calls in 0.082 CPU seconds

  Ordered by: internal time

  ncalls  tottime  percall  cumtime  percall filename:lineno(function)
    1500    0.048    0.000    0.048    0.000 {method 'recv' of
'_socket.socket' objects}
    1500    0.015    0.000    0.015    0.000 <string>:1(sendall)
    1500    0.003    0.000    0.021    0.000 Client.py:8(send_int)
    1500    0.003    0.000    0.053    0.000 Client.py:16(read_int)
     500    0.003    0.000    0.057    0.000 Client.py:19(read_int_list)
    1500    0.002    0.000    0.002    0.000 struct.py:77(unpack)
    1500    0.002    0.000    0.002    0.000 struct.py:54(pack)
     500    0.001    0.000    0.022    0.000 Client.py:11(send_int_list)
       1    0.001    0.001    0.082    0.082 runme.py:12(bench)
    1000    0.001    0.000    0.001    0.000 {method 'insert' of 'list'
objects}
    1001    0.001    0.000    0.001    0.000 {range}
     500    0.001    0.000    0.080    0.000 Client.py:28(spam)
    1500    0.000    0.000    0.000    0.000 {method 'unpack' of
'Struct' objects}
     501    0.000    0.000    0.000    0.000 {len}


1 packet @ 50000 tokens (1 very long list)
5.20953297615
        400018 function calls in 5.210 CPU seconds

  Ordered by: internal time

  ncalls  tottime  percall  cumtime  percall filename:lineno(function)
   50001    2.267    0.000    2.267    0.000 <string>:1(sendall)
   50001    1.263    0.000    1.263    0.000 {method 'recv' of
'_socket.socket' objects}
   50000    1.112    0.000    1.112    0.000 {method 'insert' of 'list'
objects}
   50001    0.137    0.000    1.490    0.000 Client.py:16(read_int)
   50001    0.134    0.000    2.478    0.000 Client.py:8(send_int)
       1    0.082    0.082    2.685    2.685 Client.py:19(read_int_list)
   50001    0.077    0.000    0.077    0.000 struct.py:54(pack)
   50001    0.073    0.000    0.089    0.000 struct.py:77(unpack)
       1    0.044    0.044    2.522    2.522 Client.py:11(send_int_list)
   50001    0.016    0.000    0.016    0.000 {method 'unpack' of
'Struct' objects}
History
Date User Action Args
2008-09-10 07:26:02thorbensetrecipients: + thorben
2008-09-10 07:26:02thorbensetmessageid: <1221031562.14.0.495802396879.issue3766@psf.upfronthosting.co.za>
2008-09-10 07:26:01thorbenlinkissue3766 messages
2008-09-10 07:26:00thorbencreate