This is likely one of two reasons:
- Randomness. Is your problem exactly the same between runs? Are you using
rand()anywhere? - Running out of RAM. If you use too much RAM, it swaps to disk and performance drops significantly. Are you keeping multiple copies of the problem in memory?
Ultimately, it’s hard to offer advice without a reproducible example.