is c faster?

Sean 'Shaleh' Perry shalehperry at home.com
Sat Jun 9 02:18:38 EDT 2001


On 09-Jun-2001 akhar wrote:
> I have a script I wrote in python , I love the time it took me to  devellop
> it faster than i could have done it in C. however after full review of my
> code I am not sure I can optimize it any more( it basicaly consist of
> importing an image and tranforming into a matrix to perform some for-looped
> operations on it) : I went from 20 seconds to 2. I can't seem to bring the
> execution time down :( . would C code be faster? by what factor? can I
> optimise my code more? how?
> 

the C version COULD be faster.  However, have you tried some of the python
imaging libs?  Many of them are implemented in C.

Another option is to put the heavy computation in C, wrap it with your existing
python and get the best of both worlds.




More information about the Python-list mailing list