xml-rpc

Walt wmich50 at theramp.net
Fri Jan 9 17:44:03 CET 2004


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
------------------------------------------------------------------------------


Thanks,
Walt



More information about the Python-list mailing list