[Cython] transform efficiency

Dag Sverre Seljebotn dagss at student.matnat.uio.no
Tue Sep 9 00:48:00 CEST 2008


(answering the question below, sorry about top-post (on cellphone)):

You do something like this:

classname = None
def visit_ClassDefNode(self, node):
    oldname = self.classname
    self.classname = node.X # name?
    # or perhaps node.entry.name
    self.visitchildren(node)
    self.classname = oldname

def visit_FuncDefNode(self, node):
    ....
    use self.classname
    ....

Dag Sverre Seljebotn
-----Original Message-----
From: "Lisandro Dalcin" <dalcinl at gmail.com>
Date: Monday, Sep 8, 2008 7:02 pm
Subject: Re: [Cython] transform efficiency
To: cython-dev at codespeak.netReply-To: cython-dev at codespeak.net

On Mon, Sep 8, 2008 at 1:46 PM, Dag Sverre Seljebotn
><dagss at student.matnat.uio.no> wrote:
>>>
>> Lisandro simply shouldn't call self.visitchildren in visit_FuncDefNode,
>> no new transform type is needed.
>>
>
>OK, I'm not visiting children. However, what should I do if I want to
>'push/pop' the class name where a method is defined?
>
>
>>
>> For my own uses, gcc still uses *a lot* more running-time than Cython,
>> so I don't have an itch to scratch here -- how are things in SAGE?
>
>That's the situation for me, too. As a side note, I never experienced
>any speed-up from using a compiled 'Scanners.so' in my projects.
>
>
>
>-- 
>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
>_______________________________________________
>Cython-dev mailing list
>Cython-dev at codespeak.net
>http://codespeak.net/mailman/listinfo/cython-dev
>



More information about the Cython-dev mailing list