Distributed App - C++ with Python for Portability?

Stefan Behnel stefan_ml at behnel.de
Mon Mar 10 04:32:07 EDT 2008


Matt Nordhoff wrote:
> Stefan Behnel wrote:
>> And if you really need the efficiency of "well-tuned raw C", it's one function
>> call away in your Cython code.
> 
> What do you mean by that?
> 
> I know nothing about how Cython compares to C in performance, so I said
> "well-tuned" because it must be possible to write C that is faster than
> Cython, though it may take some effort.

So, you write the hand-optimised function in plain C, declare it in Cython and
call it. That's what I meant. Since Cython compiles to C code, linking against
a C module is straight forward. And this still keeps you from having to write
all the Python API glue code in plain C.

Stefan



More information about the Python-list mailing list