Re: [Cython] [cython-users] freelist benchmarks

2013-02-27 Thread Robert Bradshaw
On Tue, Feb 26, 2013 at 11:24 PM, Stefan Behnel wrote: > Robert Bradshaw, 26.02.2013 21:16: >> On Mon, Feb 25, 2013 at 1:17 AM, Stefan Behnel wrote: >>> David Roe, 25.02.2013 00:00: I changed the current type pointer check to look at tp_basicsize instead. > That made it work for almo

Re: [Cython] freelist benchmarks

2013-02-27 Thread Stefan Behnel
Robert Bradshaw, 27.02.2013 09:54: > On Tue, Feb 26, 2013 at 11:24 PM, Stefan Behnel wrote: >> I imagine that the freelist could leave the initial vtable untouched in >> some cases, but that would mean that we need a freelist per actual type, >> instead of object struct size. >> >> Now, if we move

[Cython] Non-deterministic behavoiur?

2013-02-27 Thread Dave Hirschfeld
Using the following test code: import numpy as np from lapack import dgelsy from numpy.linalg import lstsq A = np.array([[ 0.12, -8.19, 7.69, -2.26, -4.71], [-6.91, 2.22, -5.12, -9.08, 9.96], [-3.33, -8.94, -6.72, -4.4 , -9.98], [ 3.97, 3.33, -2.74, -7.92, -3.2 ]]) # b =

Re: [Cython] freelist benchmarks

2013-02-27 Thread Robert Bradshaw
On Wed, Feb 27, 2013 at 5:09 AM, Stefan Behnel wrote: > Robert Bradshaw, 27.02.2013 09:54: >> On Tue, Feb 26, 2013 at 11:24 PM, Stefan Behnel wrote: >>> I imagine that the freelist could leave the initial vtable untouched in >>> some cases, but that would mean that we need a freelist per actual ty

[Cython] MemoryViews require writeable arrays?

2013-02-27 Thread Dave Hirschfeld
%%cython cimport cython import numpy as np cimport numpy as np @cython.boundscheck(False) @cython.wraparound(False) @cython.cdivision(True) cpdef double[:] return_one(double[:] x): return np.array([1.0]) In [43]: x = randn(3) ...: return_one(x) Out[43]: In [44]: x.flags['WRITEABLE'] =

Re: [Cython] MemoryViews require writeable arrays?

2013-02-27 Thread Dave Hirschfeld
Dave Hirschfeld writes: > > cpdef double[:] return_one(double[:] x): > return np.array([1.0]) > > In [43]: x = randn(3) > ...: return_one(x) > Out[43]: > > In [44]: x.flags['WRITEABLE'] = False > ...: return_one(x) > ValueError: buffer source array is read-only > > > Any help, e