Re: [Cython] C stack based coroutines (was: local variable handling in generators)

2011-05-22 Thread Stefan Behnel
Dag Sverre Seljebotn, 22.05.2011 21:48: Keep in mind that if speed is the objective, another idea is to use real C coroutines. This would likely be faster than anything we can make up ourselves; a single stack jump is bound to be faster than copying things in and out of the stack. Of course, pro

Re: [Cython] local variable handling in generators

2011-05-22 Thread Dag Sverre Seljebotn
On 05/22/2011 02:33 PM, Stefan Behnel wrote: Hi, I've been looking at the nqueens benchmark for a while, and I think it's actually not that a bad benchmark for generators. http://hg.python.org/benchmarks/file/tip/performance/bm_nqueens.py A better implementation only for Py2.7/Py3 is here: ht

[Cython] local variable handling in generators

2011-05-22 Thread Stefan Behnel
Hi, I've been looking at the nqueens benchmark for a while, and I think it's actually not that a bad benchmark for generators. http://hg.python.org/benchmarks/file/tip/performance/bm_nqueens.py A better implementation only for Py2.7/Py3 is here: https://github.com/cython/cython/blob/master/D

Re: [Cython] nonecheck directive

2011-05-22 Thread Vitja Makarov
2011/5/22 Stefan Behnel : > Dag Sverre Seljebotn, 21.05.2011 09:07: >> >> On 05/21/2011 07:57 AM, Stefan Behnel wrote: >>> >>> In the future, I think we should be more careful with potentially >>> harmful options, and always prefer safety over speed - *especially* when >>> we know that the safe way