Unstable performance of MILP with JuMP

It occasionally happens that the running time in solving a fixed MILP problem varies between a few seconds and a few minutes. The scenario remains the same regardless of the solver: I have tried Gurobi, Cbc, and HiGHS.

Typically, the first run after the Julia kernel is restarted appears to be the fastest one. Subsequent runs may slow down (i.e., I run the related cell again in Jupyter notebook).

Did anyone else encounter a similar issue? Is it due to JuMP or the solver?

1 Like

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.


Many thanks. Sorry, I found that there was a rand() call, which produced different input data. After the random seed is fixed, the performance is much more stable now.

1 Like