Cython is not necessarilly the first optimization to try. It may be worth to ensure first that your algorithm has an good complexity. Also, you can check whether you are using the right types/classes ; for example, if you use Sage real numbers in your simulations, RDF will in general be much faster than using RR. And so on. So, it really depends on the current state of your code, if it is not too long, could you please paste it here ?