Re: [sage-devel] Re: Fractal Newton basins = Need Cython help!

2011-09-24 Thread Robert Bradshaw
On Sat, Sep 24, 2011 at 2:40 PM, Simon King wrote: > PS: > > On 24 Sep., 23:22, Simon King wrote: >> > Or would it already be faster to keep Finder (which is cdef'd) as it >> > is, and call Finder.which_root as a method? >> >> I tried, and the total computation time *doubles* if I replace a call

Re: [sage-devel] Re: Fractal Newton basins = Need Cython help!

2011-09-24 Thread Robert Bradshaw
On Sat, Sep 24, 2011 at 10:26 AM, leif wrote: > On 24 Sep., 18:25, "D. S. McNeil" wrote: >> Leif wrote: >> > Any reasonable compiler does constant folding and loop-invariant code >> > motion; even Python's byte-code compiler should do that. >> >> Almost none is done.  Only the most trivial cases

Re: [sage-devel] Re: Fractal Newton basins = Need Cython help!

2011-09-24 Thread D. S. McNeil
Leif wrote: > Any reasonable compiler does constant folding and loop-invariant code > motion; even Python's byte-code compiler should do that. Almost none is done. Only the most trivial cases are handled. For example, addition: sage: preparser(False) sage: type(2) sage: def f(): :