1 | initial version |
Take a look at the last section of this. As it is quoted there, «Premature optimization is the root of all evil». So use the profiler (or put prints in the appropriate places) to find out what parts of your calculation are taking the most, and the we will be able to give you more specific answers. Good luck!