On 6/26/08, Simon Burton <[EMAIL PROTECTED]> wrote:
>  > Within that extension class, I'll have to populate the internal
>  > structure of the list with my float values. Or is it because I can use
>  > the Python/C API calls to populate, instead of calling the
>  > Python-visible append() that will give me the performance?
>
>
> You don't have to create/store python objects in your custom list.
>  Perhaps you could even alias the storage in your queue, and have
>  _zero_ copying.
>
>  It really depends where your bottleneck is, and what for/how often you are
>  using this get method. If all the work is being done at the python level
>  then i don't think any cython trickery will help. It's up to you to figure 
> it out.

We're putting data into the queue 1000 times per second, so that needs
to be fast. And we're pulling data back out a few times per second,
but pulling out large chunks, so that too needs to be fast. This is
essentially the core stuff happening in the tight while loop of our
program.

And what do you mean by aliasing the storage? When I picture that, I
think of storing the Python objects in the queue, and then creating
lists with pointers back to the objects.

I've never worked with Python at the C API level before. I've been
programming Python for over 7 years, and C for longer, but never had
to mix them, so please forgive my ignorance :)

Jay P.
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to