| Store | Cart

[Python-Dev] Python 2.3b1 has 20% slower networking?

From: Guido van Rossum <gui...@python.org>
Mon, 28 Apr 2003 10:29:55 -0400
I'm guessing that the slowdown comes from the fact that calling a
method like recv() on the wrapper object is now a Python method which
calls the C method on the wrapped object.

I wonder if the slowdown can't be easily repaired by changing the
wrapper class to copy the relevant methods to instance variables.

It would be even nicer to use subclassing instead of a wrapper
object.  I vaguely recall that I tried this before but couldn't figure
out how to do it, but I've got a feeling that it ought to be doable --
after all the C socket object has separate __new__ and __init__
methods.

I hope someone can take this ball and submit a patch -- it would
indeed be a shame to have to live with the slowdown (even if it only
shows up when using the loopback device) or to have a practice of
monkey patching socket.py.  (BTW instead of monkey-patching socket.py,
it might be easier to write "import _socket as socket".)

--Guido van Rossum (home page: http://www.python.org/~guido/)

Recent Messages in this Thread
Itamar Shtull-Trauring Apr 27, 2003 06:53 pm
Martin v. L÷wis Apr 27, 2003 08:19 pm
Itamar Shtull-Trauring Apr 27, 2003 08:23 pm
Brett Cannon Apr 27, 2003 08:32 pm
Jeff Epler Apr 28, 2003 02:04 am
Guido van Rossum Apr 28, 2003 02:29 pm
Skip Montanaro Apr 28, 2003 02:32 pm
Anthony Baxter (Anthony Baxter) Apr 30, 2003 07:29 am
Itamar Shtull-Trauring Apr 30, 2003 04:41 pm
Messages in this thread