[Spambayes] PickleRPC + hammiesrv/hammiecli

Skip Montanaro skip at pobox.com
Thu Feb 27 11:51:50 EST 2003


In an attempt to make the hammiesrv/hammiecli pair run faster, I wrote a
simple PickleRPC module which works more-or-less like a combination of
xmlrpclib and SimpleXMLRPCServer but uses raw sockets to connect (no HTTP)
and uses an ASCII byte count followed by a pickle as the serialization
format.  Using this combination, running ten messages through the scoring
roundtrip consumes 0.289s/msg of user+sys time on my Mac (including both
client and server times) and 0.464s/msg of wallclock time (just measured on
the client).  This compares favorably with these numbers for hammiefilter:
0.54s/msg wallclock and 0.483s/msg user+sys.

If you'd like to play around with the combination or see how simple an RPC
protocol can be, the three files are at

    http://manatee.mojam.com/~skip/python/PickleRPC.py
    http://manatee.mojam.com/~skip/python/hammiesrv.py
    http://manatee.mojam.com/~skip/python/hammiecli.py

Skip



More information about the Spambayes mailing list