Re: Cython help: Time taken to execute a function (profiling) changes drastically depending on image size
On Sun, Jul 21, 2013 at 4:45 AM, Chintak Sheth <chintaksheth@gmail.com>wrote:
Hi,
I am writing the code for Image inpainting using Fast Marching Method. After writing the initial implementation in Python, I am now cythonising parts of the code [1]. After profiling, the majority of the time is taken by the 3 function in [2]. In particular, even after cythonizing, `inpaint_point` takes the majority of the time.
The results of profiling for 2 different image sizes are here http://pastebin.com/aTY1bbn6. The first result is for image size of 100X100 and the second one for 512X512. The mask size which I use is constant for both cases. So, the number of function calls to `inpaint_point` for both are the same as can be seem in the profiling result.
Still why do I get such a drastic time difference in the 2 cases ? Any ideas, what I am missing here or doing inefficiently ?
Having different Cython functions using different copies of your data (i.e. one version as uint8, one as float) seems like a bad idea. And making that copy inside of a loop is probably killing performance: https://github.com/chintak/scikit-image/blob/inpaint/skimage/inpaint/_inpain...
Chintak
[1] https://github.com/chintak/scikit-image/tree/inpaint/skimage/inpaint
[2] https://github.com/chintak/scikit-image/blob/inpaint/skimage/inpaint/_inpain...
-- You received this message because you are subscribed to the Google Groups "scikit-image" group. To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
participants (1)
-
Tony Yu