From stefan at sun.ac.za Sat Apr 10 16:35:19 2010 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Sat, 10 Apr 2010 22:35:19 +0200 Subject: scikits.image performance fix In-Reply-To: <40A9BF99-B474-49D3-8ECC-01F9C0C9EA81@yale.edu> References: <40A9BF99-B474-49D3-8ECC-01F9C0C9EA81@yale.edu> Message-ID: Hey Zach Can you believe it! I've merged your changes and pushed to github. Thanks St?fan On 9 April 2010 00:19, Zachary Pincus wrote: > Hi St?fan, > > I noticed a huge performance decrease in the performance of the graph > algorithms in scikits.image when I installed from your repository on a > new lab computer; I tracked it down to a fix you made in heap.pyx to > prevent newer versions of cython from barfing on lines like: > ? ? ii = (i-1)/2 # CalcPrevAbs > For some reason, the change to: > ? ? ii = (int)(i-1)/2 # CalcPrevAbs > forces the use of the python division machinery! I think this is a > "feature" (to ape "from __future__ import division" I think), but what > a gotcha! I fixed it as: > ? ? ii = (i-1)//2 # CalcPrevAbs > > > Anyhow, if you pull from heap-perf on http://github.com/zachrahan/scikits.image > ?, you'll get the fix (and an additional correctness issue elsewhere > in mcp.) > > Zach