Is anyone using Python for .NET?

Terry Reedy tjreedy at udel.edu
Thu Dec 18 06:17:18 CET 2003


"yaipa h." <yaipa at yahoo.com> wrote in message
news:6e07b825.0312162307.7e2d9306 at posting.google.com...
> > In another year it is possible that Python
compiled to IL will be faster
> > than CPython in most cases. But it is really
hard to say.
>
> It appears that it already does...
>
>
http://www.python.org/~jeremy/weblog/031209a.html

I think the microbenchmark results are more
interesting that the PyStone result:
[quotes from page referenced above]:

>                      IronPython-0.1  Python-2.3
Jython-2.1
>function call   0.19            1.00
1.33

The speedup here apparently comes from having
specialized internal call functions for the common
cases of function calls..  For example, given

def f(x): return x*x
[stuff]
y=f(a)

and no rebinding of f anywhere and a compiler that
does a global analysis to detect that lack of
rebinding, the call of f can be implemented with a
Call-with-1-required-arg bytecode instead of the
current Call-with-anything-possible bytecode with
considerable speedup.  2 and 3 required, without
and with additional optional args, are also useful
special cases.

And yes, the possibility of doing something
similar in CPython for 2.4 *has* been discussed on
PyDev.

> integer add     0.59            1.00
1.08

I believe Psyco can do better than this

> string.replace  0.92            1.00
1.40

In CPython, this is a call to a C function so C#
or .NET IL cannot gain much.

> range(bigint)   5.57            1.00
16.02

Of course, one should use xrange instead.

> eval("2+2")     66.97           1.00
91.33

Terry J. Reedy








More information about the Python-list mailing list