On Sat, Feb 23, 2008 at 1:24 PM, William Stein <[EMAIL PROTECTED]> wrote:
>  I'm actually pretty curious about how pexpect and XMLRPC both
>  done locally compare speedwise.  I've done some simple benchmarks
>  below.  The short answer is that pexpect is between several hundred
>  to several thousand times faster than XMLRPC, depending on the
>  platform.

More benchmarks:
pyxmlrpc (http://sourceforge.net/projects/py-xmlrpc/) is a c
implementation that is roughly 2 times faster  than xmlrpclib on small
inputs. Here are some numbers on linux running sage 2.10.1:

pyxmlrpc:
sage: %timeit ("c.execute('add', [2r, 3r])")
1000000 loops, best of 3: 65.8 ns per loop
sage: timeit c.execute('add', [2r, 3r])
1000 loops, best of 3: 1.46 ms per loop


xmlrpclib:
sage: %timeit ("s.add([2r,3r])")
1000000 loops, best of 3: 158 ns per loop
sage: timeit s.add([2r,3r])
100 loops, best of 3: 1.94 ms per loop


overall:
sage: time for _ in range(10^3): gp.eval('2+3')
CPU times: user 0.34 s, sys: 0.10 s, total: 0.45 s
Wall time: 0.82

sage: time for _ in range(10^3): c.execute('add', [2r, 3r])
CPU times: user 0.08 s, sys: 0.02 s, total: 0.10 s
Wall time: 1.66

sage: time for _ in range(10^3): s.add([2r,3r])
CPU times: user 0.99 s, sys: 0.38 s, total: 1.37 s
Wall time: 2.51

Note: The pyxmlrpc is currently unmaintained (last realease was in
2004) and needs to be patched against 2.5 (there's a fix at the bottom
of 
http://sourceforge.net/tracker/index.php?func=detail&aid=1734819&group_id=23992&atid=380301).

didier

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to