[Patches] [ python-Patches-458245 ] Reduce import time for xmlrpclib

noreply@sourceforge.net noreply@sourceforge.net
Mon, 10 Sep 2001 06:00:27 -0700


Patches item #458245, was opened at 2001-09-03 19:55
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=458245&group_id=5470

Category: Modules
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Cesar Eduardo Barros (cesarb)
Assigned to: Fredrik Lundh (effbot)
Summary: Reduce import time for xmlrpclib

Initial Comment:
This patch reduces the load time for xmlrpclib.py (my
tests show it's about half the load time with the
patch) by not loading xmllib when it's not needed. It
also simplifies getparser() (by chosing the
parser/unmarshaller statically) and avoids declaring
slower parsers/unmarshallers when a faster version is
available.

The indentation is a bit odd, to avoid touching a large
amount of code because of indentation changes (to
improve the readability of the patch). If it is to be
accepted, it might be a good idea to reindent the
affected blocks of code.

The only test made was the trivial one in the module
(getStateName).

The patch is against CVS revision 1.4 of xmlrpclib.py

----------------------------------------------------------------------

>Comment By: Fredrik Lundh (effbot)
Date: 2001-09-10 06:00

Message:
Logged In: YES 
user_id=38376

The statical binding breaks existing user code (some
applications depend on being able to plug in a sloppier
parser than the default).

I've implemented another variant of lazy loading,
which gives a 20x speedup in my test setup.  YMMV,
as usual.

Will appear in a repository near you real soon now.

Thanks /F

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=458245&group_id=5470