[Tutor] Cython question

Albert-Jan Roskam fomcl at yahoo.com
Sat Jul 2 11:49:45 CEST 2011


Hi,

Some time ago I finished a sav reader for Spss .sav data files (also with the 
help of some of you!):
http://code.activestate.com/recipes/577650-python-reader-for-spss-sav-files/

It works fine, but it is not fast with big files. I am thinking of implementing 
two of the functions in cython (getValueChar and getValueNum).
As far as I understood it requires the functions to be re-written in a 
Python-like langauge, 'minus the memory manager'. That little piece of code is 
converted to C and subsequently compiled to a .dll or .so file. The original 
program listens and talks to that .dll file. A couple of questions:
-is this a correct representation of things?
-will the speed improvement be worthwhile? (pros)
-are there reasons not to try this? (cons)
-is it 'sane' to mix ctypes and cython for nonintensive and intensive 
operations, respectively?

Thanks in advance!

Cheers!!
Albert-Jan


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
All right, but apart from the sanitation, the medicine, education, wine, public 
order, irrigation, roads, a fresh water system, and public health, what have the 
Romans ever done for us?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110702/4b530f71/attachment.html>


More information about the Tutor mailing list