Perhaps only useful for morale/enthusiasm, I'd think this sort of  
thing is still on topic, so... :->

I've been having problems with part of my code. I ended up rewriting a  
very similar piece of code somewhere else, and it was **much** faster.  
Didn't quite get it, but just shrugged and let it go.

Then I wanted to run some more ambitious experiments with the old  
code. My progress bar told me (when it finally got enough progress to  
tell me anything) that the experiment would probably take a couple of  
weeks! Now, this estimate was probably highly inaccurate, but still a  
bit too high for my taste -- I had hoped to get some results by the  
next day... (Actually, I found this estimate when I looked at the  
computer the morning after I started the experiment.) So I just gave  
up. Until a colleague convinced me to have another look.

It turns out I had renamed my iteration variables, and some related  
variables used to index a rather large NumPy array ... but I *hadn't*  
updated the cdef declarations -- so they were still for the old names.

Easy enough to fix. Now half the experiment has run, and there's an  
estimated 20 minutes left :-D

Now, the speedup probably isn't *quite* as dramatic as it seems (as I  
suspect the estimate of the progress bar was a bit off -- but it had  
only managed to get 2% done during the night). But still ... I guess  
the large factor here is because I had a double for loop with NumPy  
indexing in the innermost loop. So if each of these gets a speedup  
factor, the total there should be the cube of that speedup factor,  
right?

Anyway: Once again, Cython let me do experiments I probably wouldn't  
have done otherwise. Yay :)

(Or, to put it differently: Once again, I'm too n00bish to make my  
experiment run fast enough the first time around ;)

- M

-- 
Magnus Lie Hetland
http://hetland.org


_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to