On Jun 25, 2009, at 6:50 AM, Ethan Van Andel wrote: > > Thanks for the help so far. > > I've come a fair way and implemented a good portion in cython. > However, the speedup was only minor (< a factor of 2) and I suspect > I'm missing something. If anyone can give me any tips on how to > optimize the code, that would be most appreciated. Tips on the code > itself or general good-practice would be great. At this point, from > reading the cython user manual and numpy tutorial, I guess that I > should do the following, but do not know how. > > 1: make the whole class into a struct or as C'ish as possible > > 2: ctypedef the np.complex128 type or something.
I bet what will help the most is to do http://docs.cython.org/docs/numpy_tutorial.html (though there are still some issues about doing this from Sage that need to be worked out). Also, look at the .html file produced and the yellow parts can give an indication of where you're spending a lot of time. - Robert --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---
