urllib slow on FreeBSD 4.7? sockets too

Bengt Richter bokr at oz.net
Sat Nov 23 13:21:52 EST 2002


On Sat, 23 Nov 2002 02:38:16 -0700, "Mike Brown" <mike at skew.org> wrote:

>"Bengt Richter" <bokr at oz.net> wrote in message
>news:arm32g$icu$0 at 216.39.172.122...
>> I don't have a real handy way to duplicate your experiment (not having BSD
>on the other box),
>> but if it's easy for you, I'd be interested in how fast/slow this mod of
>your test runs:
>> (change file an url to taste)
>>
>> =====
>> #!/usr/bin/python
>> # turlread.py
>> [...]
>
>bytes: 4241.5K; time: 9.027s (469 KB/s)
>
Actually, you'll note I wrote an output file as part of the
timed sequence, whereas Jarkko just accumulated the list of
strings and joined them in memory, so my "version" wasn't
really comparable. Sorry, I was jumping ahead ;-/

The better comparison would be to accumulate bytes as he did
but use u.read(16 * 1024) instead of os.read(fn, 16 * 1024)

Regards,
Bengt Richter



More information about the Python-list mailing list