[Pythonmac-SIG] Performance on the Mac - A suggested fix
Jack Jansen
jack@oratrix.nl
Thu, 21 Jun 2001 23:59:53 +0200
Ok, so what the problem boils down to is that GUSI is waiting for you
disk I/O to complete and does a yield at that point.
The problem is that it's GUSIYieldMode parameter only has one blocking
mode, so it doesn't distinguish between an expected short block (disk
I/O) or long block (network I/O or user interaction).
The problem is exacerbated by the default buffer size, which is only
8K(!).
As a quick solution you could set the default buffer size to something
a lot bigger. As you're running from source: change the 8192 in
GUSISocketMixins.h to something a lot bigger. If that works we can
start thinking of a general solution. GUSI itself has an interface for
changing the buffer size: setsockopt(SOL_SOCKET, SO_RCVBUF) and
setsockopt(SOL_SOCKET, SO_SNDBUF) allow you to change it. We could do
these calls from C (but I'd like feedback on where to do them) or we
could expose this API to Python (in the file object? In the mac
module? how?).
I'll also ask on the GUSI mailing list what other people do about this,
--
Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm