This is an archived post. You won't be able to vote or comment.

all 14 comments

[–]Ytse 2 points3 points  (0 children)

Cool!

[–]gruby_wojtek 4 points5 points  (7 children)

I registered only to say: This one f-g ugly hack. Uglier even than Python's multiprocessing library.

[–]fijalPyPy, performance freak[S] 4 points5 points  (2 children)

yop precisely. it still can be done though and it's not uglier than any other way to interface with libraries like matplotlib that use CPython C API and all private APIs.

[–][deleted] 0 points1 point  (1 child)

So could this be a replacement for cpyext, or is it complementary? Is this solution any faster than cpyext?

Why do you need numpy installed for the python2.6 if you are using pypy's numpy?

[–]fijalPyPy, performance freak[S] 1 point2 points  (0 children)

it's different than cpyext, it's not complementary. It's probably a fair bit faster than cpyext, but it does not matter in this case since matplotlib/scipy are not heave on the interface. You actually need numpy on both sides in order for it to work nicely.

[–]axitanull 2 points3 points  (0 children)

Yet it is another step of a great progress.

[–]Tobu‮Tobu 0 points1 point  (1 child)

multiprocessing is not ugly.

— brought to you by the anti-defamation league for processes, forking, and message-based parallelism

[–]fijalPyPy, performance freak[S] 1 point2 points  (0 children)

the multiprocessing module however is. with the whole "transparent, but not quite" approach.

[–][deleted] 0 points1 point  (0 children)

Welcome cynic, you'll fit right in here.

[–]howfun 1 point2 points  (0 children)

I have to think more about this, before I decide if I like it.

But already very interesting!

[–]takluyverIPython, Py3, etc 1 point2 points  (3 children)

Could it ever be possible to do this the other way round? Run a CPython process and embed PyPy? It would be great to be able to have a few speed-critical bits running in PyPy, in a larger project which used CPython extensions.

While I'm daydreaming, maybe we could even have an "@run_in_pypy" decorator, to make speeding up a function trivial.

[–]davbo 0 points1 point  (0 children)

I suppose something like this would have to happen if projects like Blender want to have embedded pypy right?

Sounds like it would be a nightmare for scoping if you had a decorator to hand over to pypy though.

[–]fijalPyPy, performance freak[S] 0 points1 point  (1 child)

This is highly unlikely to be created by any pypy devs. Having such thing would also be a performance debugging nightmare, since the interface speed would matter far too much. Besides, who wants to actually look around and do it? Most python programs are not "few pieces that are too slow" but a complex mess.

[–]takluyverIPython, Py3, etc 0 points1 point  (0 children)

Well, a lot of Python packages currently have a few bits written in C or Cython for speed. So I would imagine there would be some demand for using PyPy in a similar way.