[Cython] Utilities, cython.h, libcython

Vitja Makarov vitja.makarov at gmail.com
Fri Oct 7 18:01:02 CEST 2011


2011/10/7 Vitja Makarov <vitja.makarov at gmail.com>:
> 2011/10/7 Stefan Behnel <stefan_ml at behnel.de>:
>> Vitja Makarov, 06.10.2011 23:12:
>>>
>>> Here is small comparison on compiling urllib.py with cython:
>>>
>>> ((e8527c5...)) vitja at mchome:~/work/cython-vitek-git/zzz$ time python
>>> ../cython.py urllib.py
>>>
>>> real    0m1.699s
>>> user    0m1.650s
>>> sys     0m0.040s
>>> (master) vitja at mchome:~/work/cython-vitek-git/zzz$ time python
>>> ../cython.py urllib.py
>>>
>>> real    0m2.830s
>>> user    0m2.790s
>>> sys     0m0.030s
>>>
>>>
>>> It's about 1.5 times slower.
>>
>> I assume this uses a compiled Cython? That's a pretty serious regression for
>> plain Python code then. Again, this needs proper profiling.
>>
>
> No, that was pure python cython.
>

I've added return statement on top of CythonScope.test_cythonscope,
now I have these timings:

(master) vitja at mchome:~/work/cython-vitek-git/zzz$ time python
../cython.py urllib.py

real	0m1.764s
user	0m1.700s
sys	0m0.060s



>> We may also want to disable certain steps in the pipeline based on the
>> syntax features used. If a feature is not used that has its own (set of)
>> visitors, we can disable them completely. Detection already happens based on
>> the .pyx/.py distinction, but could additionally use a detector (e.g. in the
>> post-parse phase) that sets up skip flags. One example is the closure
>> building step, which could be skipped if there are no closures.
>>
>
>
> One more think I've found is that many unused utilities are loaded.
>





-- 
vitja.


More information about the cython-devel mailing list