[Python-Dev] xmlrpclib speed boost

Thomas Wouters thomas@xs4all.net
Mon, 1 Oct 2001 20:45:49 +0200


On Mon, Oct 01, 2001 at 12:55:37PM -0500, Skip Montanaro wrote:

> This change may be deemed not to be the correct fix as far backwards
> compatibility is concerned (it uses the "from m import x as y" feature which
> was new with 2.0 I think).  If someone alters this fix, please don't put the
> import back into the functions that call cgi.escape.

Why not ? Moving the import to the top level just causes the slowdown to
occur at a different moment. If this is really the problem, the slowdown
should occur only the first time you use a particular function (unless you
explicitly un-import cgi somehow ?)

Importing cgi only in the functions that actually use it, in order to avoid
the slowdown unless it's really necessary, sure seems like a sensible
solution to me :-)

-- 
Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!