[SciPy-Dev] To use C code or Cython code?

Julian Taylor jtaylor.debian at googlemail.com
Tue Aug 26 13:58:38 EDT 2014


On 26.08.2014 14:36, Sri Krishna wrote:
> Hi,
> 
> I'm new to the Scipy-Dev mailing list, looking to contribute wherever I
> can. I was looking through the open issues and saw this issue
> <https://github.com/scipy/scipy/issues/3184>, regarding a speed-up for
> the convolve2d function.
> 
> My confusion arises from the SciPy coding guidelines
> <https://github.com/scipy/scipy/blob/master/HACKING.rst.txt> which
> states that using Cython is much preferable to using plain C/C++/Fortran.
> 
> Would it be desirable then to change the C code of signal/firfilter.c to
> a Cythonized code?
> 

hi,
I think it would be better to keep the core of the function in plain
C/C++ or Fortran.
As this is a function that can profit greatly from lowlevel use of the
hardware we retain more flexibility for optimization by staying with a
lowlevel language. Cython does not offer any advantage at that level of
the code and would make it impossible(?) to use of assembler or intrinsics.

The wrapping to python on the other hand is probably preferable in in
Cython as it simplifies a lot of mundane and error prone issues.

Cheers,
Julian



More information about the SciPy-Dev mailing list