Hi KaShining,

Yes, the issue then is that pure Python equivalents are often slower
than their C version --- for example, this red_black_tree_mod file is
huge for the job (more than 1000 lines), written in a Java-ish style
with tons of small overridden methods, but full of properties,
recursive function invocations, and so on.  Getting 10 times slower
than the C version is not good, but I guess that the C version was
more optimized.  Often we can hope to get at most a few times slower.

PyPy is not faster at everything.  Usually there is no way it can be
faster than a program that exercices only a CPython C extension
module.  In some cases like this one, the solutions you have with PyPy
are all a lot slower --- both some pure Python version, and the cpyext
version.  The pure Python version could be rewritten with
performance-on-PyPy in mind (just like the C version was written with
performance-on-CPython in mind).

Note that the point of red_black_tree_mod is very unclear to me.  It
seems to replace plain dicts.  Why can't you use plain dicts?


A bientôt,

Armin.
_______________________________________________
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to