FYI: Cython vs Pyrex

John Arbash Meinel john at arbash-meinel.com
Mon May 9 12:00:04 UTC 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 5/9/2011 12:49 PM, INADA Naoki wrote:
> I tried simple test on IPython.
> 
> a = range(10000)
> %timeit _bencode_pyx.bencode(a)
> 
> Cython: 2.5ms
> Pyrex: 3.04ms
> 
> Now Bazaar uses Pyrex when both of Pyrex and Cython is installed.
> How about use Cython for default?
> 

I'm fine switching. For my personal projects I've switched completely to
Cython. I don't think 3ms vs 2.5ms really matters. What would be nicest
about switching to Cython is being able to program for it. So being able
to do:

 cdef list foo
 foo = []
 foo.append(x)

Rather than

 cdef foo
 foo = []

 PyList_Append(foo, x)

etc.

However, we need to make sure that all the platforms we care about
(especially PQM) has a Cython package, especially one that is new enough.


Short-term, though, I'd be happy for us to just switch the order of the
try/import/except checks to test for Cython first.

(I generally run without Pyrex installed for this reason, so I'm sure
bzr runs pretty stable under Cython.)

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk3H10QACgkQJdeBCYSNAAOv/ACffWyGvBnU/FyJNKGEYX2GnmUU
tXwAoIn8kAdRKqpjqsTh2lukaWsaS41x
=+CdB
-----END PGP SIGNATURE-----



More information about the bazaar mailing list