Armin Rigo, 08.07.2011 11:18:
Before attacking the problem with the JIT, we should understand better
why PyPy is 4-8 times slower than CPython.  Normally you'd expect the
factor to be at most 2.  I suppose the answer is that our
itertools.repeat() is bad for some reason.

You shouldn't forget that itertools contains extremely well optimised C code. I recently tried to (algorithmically) optimise the pure Python implementations from the CPython docs for Cython, and ended up with timings between 10% faster and 50% slower. It's actually hard to reach up to the raw power of hand tuned C code here.

http://blog.behnel.de/index.php?p=163
http://blog.behnel.de/index.php?p=185

Given that some of the functions don't execute anything more than a couple of assembly instructions per cycle, you'll have to send a really well tuned high level implementation into the race to even come close. I would expect that PyPy's implementation simply wasn't written for that.

That being said, it would be nice to have an itertools micro benchmark for the common Python test suite.

Stefan

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

Reply via email to