is c faster?

kosh kosh at aesaeion.com
Sat Jun 9 02:31:26 EDT 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?
> 
> Stephane
> 
> NB: I have a dual-celeron 400mhz with 256Mo of ram and a 20 gig 7200rpm
> HDD Also anybody with a G4 with PIL and numpy install to test the speed of
> my code?(my friend has a 1GHz and it takes him .65 sec to execute I would
> like to know if an altivec enhanced computer would fair better)
> 
> 
> 

What does the code for the for loop look like? There are some surprising 
speedups you can get in python with some strange optimizations.




More information about the Python-list mailing list