On Thu, Sep 24, 2009 at 7:16 PM, Robert Bradshaw
<[email protected]> wrote:
> On Sep 24, 2009, at 2:50 PM, Lisandro Dalcin wrote:
>
>> Sorry, I was not clear enough... if 'profile' directive is of type
>> 'bool', but initialized to None, it seems that at some point Dag's
>> transform machinery puts a 'False' there,
>
> Ah.
>
>> so the
>> "directives['profile'] is None" does not work as expected...
>>
>> So, in short, the 'profile' directive should be 'False' by default;
>> but if enabled,  the macro in the C code should definitely default to
>> 1, as currently done.
>
> Actually, None (the default) was a special case--enabled for non-
> inline non-nogil functions. It requires the GIL, so we need that at
> least, and I disabled it for inline functions for performance reasons.
>

Ah! I see... but that way is broken...

> Maybe rather than True/False, it should be an int with different
> thresholds?

I think so.

>
> If so, what should they be?
>

What about this?:

0: do no profile at all
1: profile only 'def' functions
2: profile 'def' and 'cdef' but not cdef+inline
>=3: profile all, i.e def, cdef, and cdef+inline.

You could also merge 1 and 2 in case the distinction is not worth enough.

BTW, we could also support the support C code being generated, but
with the define below by default:

#ifndef CYTHON_TRACING
#define CYTHON_TRACING 0
#endif

So we could be able to define a default level of tracing (1,2,3) and
how to compile the C code by default..

Just throwing some ideas...

>
> Should any level be on by
> default? (I think so.)
>

I personally prefer that profile be off by default (level 0 in my
proposal above), but as always, I do not bother too much about
defaults provided that I can change it :-)

Anyway, until you can have some more benchmarking (or in the case you
do not have the time to do the benchmarking), I think you should
disable the beast, just in case do not have it unintentionally enabled
in final release 0.11.3...


> - Robert
>
> _______________________________________________
> Cython-dev mailing list
> [email protected]
> http://codespeak.net/mailman/listinfo/cython-dev
>



-- 
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
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to