Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #59375

pypy and ctypes

From Peter Chant <pete@petezilla.co.uk>
Newsgroups comp.lang.python
Subject pypy and ctypes
Date 2013-11-14 00:39 +0000
Message-ID <omidlaxggl.ln2@phoenix.fire> (permalink)

Show all headers | View raw


I'm looking to speed up some python code.  Replacing the python 
interpreter with pypy was impressive.  I noted that use of ctypes (in 
cython?), specifically declaring variables as below, was reported as 
giving a useful result:

cdef float myvar
cdef int i

under cython can provide a useful speed increase even if sections of 
code are not re-written in C.  Does this also work in PyPy?  From 
googling I keep getting pointed at ffi - but that seems to relate more 
to calling c-libraries rather than what I'm trying to do - seeing if 
there are any simple speed ups by declaring variables.

Or is it that - if I keep the code as simple as possible, PyPy is about 
as fast as you can get?

Pete

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

pypy and ctypes Peter Chant <pete@petezilla.co.uk> - 2013-11-14 00:39 +0000
  Re: pypy and ctypes Neil Cerutti <neilc@norwich.edu> - 2013-11-14 15:13 +0000
    Re: pypy and ctypes Peter Chant <pete@petezilla.co.uk> - 2013-11-14 23:05 +0000

csiph-web