xml-rpc

W

Walt

Newbie using xmlrpclib
Curious about why the same very simple xml-rpc demo code should execute
quickly under python2.1 but very slowly under python2.3

python2.1 ~4 seconds
python2.3 ~24 seconds on the same machine

Is there a well known reason for the difference?

Here's the code:
-----------------------------------------------------------------------------
from xmlrpclib import *
import sys
server = Server("http://wmich.freeshell.org/betty.php")
try:
print "Got '" + server.examples.getStateName(32) + "'"
print "----------------------------------------------------"
r = server.examples.echo('Three "blind" mice - ' + "See 'how' they run")
print r
print "--------------------------------------------"
# name/age example. this exercises structs and arrays
a = [ {'name': 'Dave', 'age': 35}, {'name': 'Edd', 'age': 45 },
{'name': 'Fred', 'age': 23}, {'name': 'Barney', 'age': 36 }]
r = server.examples.sortByAge(a)
print r
print "---------------------------------------------"
except Error, v:
print "XML-RPC Error:",v
 
S

Skip Montanaro

Walt> Curious about why the same very simple xml-rpc demo code should
Walt> execute quickly under python2.1 but very slowly under python2.3

Walt> python2.1 ~4 seconds
Walt> python2.3 ~24 seconds on the same machine

Walt> Is there a well known reason for the difference?

Nope. I tweaked your script to contact my XML-RPC server over the net
(about 20-30ms ping times between client and server) and just make
server.echo() calls. It took between 1.6 and 2.5 seconds real time running
python 2.4a0 (aka CVS) on the client and 2.2.3 on the server. Note that the
server is in production, so the different times were probably due to
transient server load.

Skip
 
G

Graham Dumpleton

Skip Montanaro said:
Walt> Curious about why the same very simple xml-rpc demo code should
Walt> execute quickly under python2.1 but very slowly under python2.3

Walt> python2.1 ~4 seconds
Walt> python2.3 ~24 seconds on the same machine

Walt> Is there a well known reason for the difference?

Nope. I tweaked your script to contact my XML-RPC server over the net
(about 20-30ms ping times between client and server) and just make
server.echo() calls. It took between 1.6 and 2.5 seconds real time running
python 2.4a0 (aka CVS) on the client and 2.2.3 on the server. Note that the
server is in production, so the different times were probably due to
transient server load.

Any difference in speed between different versions of Python can sometimes
be accounted for by there not being sgmlop or expat modules installed with
the slower version of Python. But then, if the data set going back and forth
is small, this shouldn't really be the case.

Still worthwhile to keep in mind later on if the amount of data does increase.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
474,175
Messages
2,570,942
Members
47,490
Latest member
Finplus

Latest Threads

Top