2010/11/25 Stefan Behnel <stefan...@behnel.de>:
> Vitja Makarov, 25.11.2010 13:39:
>> Hi, I've tried to optimize closures.
>>
>> I think I should create ticket for this.
>
> Yes, please do. There doesn't seem to be one yet.
>

Ticket is now here http://trac.cython.org/cython_trac/ticket/599

>
>> Closure optimizations:
>>   * Don't add entries to closure if they will not be later used
>>   * Don't add outer scope to closure if it will not be used
>>   * Don't pass closure scope to functions that don't use it
>>   * Don't create empty closure classes.
>>   * If closure class contains outer scope only pass outer scope
>> directly (called is_passthrought)
>>
>> Please review attached patch.
>
> I took a quick look through it and it looks good. The tests still pass,
> although I'm not very confident in the closure tests that we have, given
> that there aren't many that involve typed closure variables or type
> inference. But at least those that are there didn't break.
>

Closure tests helped very much to implement all this stuff.
Type inference should be okay because it's already done for inner entry.
And closure class entries are created with defined type.

I'm not sure (about my PC load) but is seems that whole pyregr test
takes a little bit less time.

> Anyway, I think the patch is good enough to push it on to Hudson to see
> what it has to say about it.
>
> Thanks!
>
> Stefan

Interesting to see.

-- 
vitja.
_______________________________________________
Cython-dev mailing list
Cython-dev@codespeak.net
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to