Re: [pypy-dev] your thoughts on low level optimizations

2011-09-03 Thread Gertjan van Zwieten
Hi Armin > I would say that in this case, keeping your module in C with a > C-friendly API is the most future-proof solution I can think of. That > means so far --- with today's tools --- that you need to wrap it > twice, as a CPython C extension module and as a pure Python ctypes, in > order to

Re: [pypy-dev] your thoughts on low level optimizations

2011-09-02 Thread Yury Selivanov
Thank you, Armin. On 2011-09-02, at 2:48 AM, Armin Rigo wrote: > Hi Yury, > > On Thu, Sep 1, 2011 at 8:26 PM, Yury Selivanov > wrote: >> Will it be possible at some point to write modules for pypy in RPython >> without the need to rebuild the entire interpreter? > > I've added an answer to t

Re: [pypy-dev] your thoughts on low level optimizations

2011-09-01 Thread Armin Rigo
Hi Yury, On Thu, Sep 1, 2011 at 8:26 PM, Yury Selivanov wrote: > Will it be possible at some point to write modules for pypy in RPython > without the need to rebuild the entire interpreter? I've added an answer to this Frequently Asked Question to https://bitbucket.org/pypy/pypy/raw/default/pyp

Re: [pypy-dev] your thoughts on low level optimizations

2011-09-01 Thread wlavrijsen
Hi, On Thu, 1 Sep 2011, Armin Rigo wrote: Reflex is another solution that is likely to work very nicely if you can rewrite your C module as a C++ module and use the Reflex-provided Python API extracted from the C++ module. for most practical purposes, the rewriting of C -> C++ for wrapping pur

Re: [pypy-dev] your thoughts on low level optimizations

2011-09-01 Thread Yury Selivanov
On 2011-09-01, at 1:03 PM, Armin Rigo wrote: >> Back on topic, it surprised me, too, that RPython components are not >> modular. Do I understand correctly that this means that, after making >> modifications to the component, the entire PyPy interpreter needs to be >> rebuilt? > > Yes. You should

Re: [pypy-dev] your thoughts on low level optimizations

2011-09-01 Thread Maciej Fijalkowski
Hi Gert Jan. Let me clarify what I got from your question - does it make sense to write performance sensitive code in C, or would PyPy optimize loops well enough? If you want to use only PyPy, you can quite easily use numpy arrays to get a C-like performance. indeed, hakan ardo was able to run hi

Re: [pypy-dev] your thoughts on low level optimizations

2011-09-01 Thread Armin Rigo
Hi Gertjan, On Thu, Sep 1, 2011 at 1:59 PM, Gertjan van Zwieten wrote: > Thanks for the quick reply, this is very helpful information and in some > ways surprising. Let me just try to confirm that I got all this correctly so > that I am sure to draw the right conclusions. The meta-answer first:

Re: [pypy-dev] your thoughts on low level optimizations

2011-09-01 Thread Gertjan van Zwieten
Hi Wim, Thanks for the quick reply, this is very helpful information and in some ways surprising. Let me just try to confirm that I got all this correctly so that I am sure to draw the right conclusions. First of all, to clarify, I understand that the overhead of calling into C is not such a big

Re: [pypy-dev] your thoughts on low level optimizations

2011-08-30 Thread wlavrijsen
Hi Gertjan, With PyPy at the horizon, I am not so sure anymore. For one I'm not sure if PyPy will ever be able to use the C module, or use it efficiently it's only the crossing into and out of a C extension module through cpyext that is less than optimal. If that crossing does not happen often