[Cython] GCC, warning ‘__Pyx_Print’ defined but not used (Python 2.X)
Lisandro Dalcin
dalcinl at gmail.com
Fri Mar 6 21:56:48 CET 2009
On Fri, Mar 6, 2009 at 6:29 PM, Robert Bradshaw
<robertwb at math.washington.edu> wrote:
> On Mar 6, 2009, at 12:20 PM, Lisandro Dalcin wrote:
>> Robert, I believe some times we complicate implementations too much
>> for the sake of optimization... :-)
>
> This was motivated by some code where printing was the dominant step
> in the runtime. Unfortunately, PySys_GetObject((char *)"stdout")
> (which must be called every time) still takes some time.
>
Mmm.. Are you sure that's the only cause? Every thing you need to
print involve calls to PyObject_Repr, and they involve creating string
objetcs... I would never expect that 'print' could run fast retaining
its generality...
Anyway, I've pushed a fix calling __Pyx_Print() after return... Well,
other compilers (Intel) would warn about unreachable code... Anyway
Cython generates a lot of unreachable code :-) ... some day far in the
future....
--
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
More information about the Cython-dev
mailing list