Hi all,

I have code that generates about 40000 instances of a certain cdef'd class.

I would like to know:

1) If I define my cdef class in my_class.pyx, and then, in main.pyx do:

from my_class import MyClass

[.. instantiate many, many MyClass objects ..]

Does this happen in C, or am I making Python calls along the way?

2) Is there a standard pattern for lowering the cost of instance creation?

I think I may have to switch to structs instead of classes, but then I
no longer have convenient methods or array members.  Maybe I should
rewrite my class to have many static methods that operate on a struct,
and then collect the structs as data instead of the full instances.

Any input much appreciated,

Regards
Stéfan
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to