# Heterogenous running time Ipopt

**URL:** <https://discourse.julialang.org/t/heterogenous-running-time-ipopt/87813>\
**Category:** Optimization (Mathematical)\
**Tags:** jump, ipopt\
**Created:** [September 26, 2022, 1:41pm UTC](https://discourse.julialang.org/t/heterogenous-running-time-ipopt/87813 "2022-09-26T13:41:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mb96](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mb96/32/45786_2.png) [@mb96](https://discourse.julialang.org/u/mb96)\
**Post date:** [September 26, 2022, 1:41pm UTC](https://discourse.julialang.org/t/heterogenous-running-time-ipopt/87813/1 "2022-09-26T13:41:33Z")

</div>

I know that the first time running JuMP takes more time due to compilation issues but I was expecting roughly the same running time after that, however as it can be seen below the “variance” is quite high.

 ![Captura de Pantalla 2022-09-26 a la(s) 09.11.17](https://global.discourse-cdn.com/julialang/original/3X/d/9/d92ae2bc606357a58f76c125d378ce5066ae3476.jpeg)

Does someone know why this is happening?  
Thanks a lot!

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [September 27, 2022, 2:52am UTC](https://discourse.julialang.org/t/heterogenous-running-time-ipopt/87813/2 "2022-09-27T02:52:23Z")

</div>

You can look at the result of `solve_time(model)` to see if the difference is time spent in Julia or Ipopt.

Ultimately though, you’ll need to profile to see where the time is being spent.

Two useful tools for this are:

- [GitHub - timholy/ProfileView.jl: Visualization of Julia profiling data](https://github.com/timholy/ProfileView.jl)
- [GitHub - KristofferC/TimerOutputs.jl: Formatted output of timed sections in Julia](https://github.com/KristofferC/TimerOutputs.jl)

---

<div class="post-metadata">

**Author:** ![mtanneau](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mtanneau/32/17787_2.png) [@mtanneau](https://discourse.julialang.org/u/mtanneau)\
**Post date:** [September 28, 2022, 12:31am UTC](https://discourse.julialang.org/t/heterogenous-running-time-ipopt/87813/3 "2022-09-28T00:31:05Z")

</div>

Computing times can be (heavily!) impacted by other tasks running on the same machine.  
I’ve seen speedup/slowdowns as high as 6x just by having other programs running.

In addition to odow’s comments, I would recommend, as much as possible, to avoid other tasks running. This is best done by requesting a full node on a computing cluster – if you have access to that. If you’re running on your laptop / desktop machine: stop other applications, and try to use the machine as little as possible while your program is running. That might help reduce the variance.

---

<div class="post-metadata">

**Author:** ![dlakelan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlakelan/32/8491_2.png) [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Post date:** [September 28, 2022, 1:54am UTC](https://discourse.julialang.org/t/heterogenous-running-time-ipopt/87813/4 "2022-09-28T01:54:05Z")

</div>

are these starting from random initial points? If so that’s likely the cause of the variation.

---

<div class="post-metadata">

**Author:** ![mb96](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mb96/32/45786_2.png) [@mb96](https://discourse.julialang.org/u/mb96)\
**Post date:** [September 28, 2022, 12:23pm UTC](https://discourse.julialang.org/t/heterogenous-running-time-ipopt/87813/5 "2022-09-28T12:23:31Z")

</div>

Right, with 8 cores on my laptop I would not expect interference given that other possible tasks were possibly googling something but thanks for the comment. I was not aware of the potential severity of it.

---

<div class="post-metadata">

**Author:** ![mb96](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mb96/32/45786_2.png) [@mb96](https://discourse.julialang.org/u/mb96)\
**Post date:** [September 28, 2022, 12:24pm UTC](https://discourse.julialang.org/t/heterogenous-running-time-ipopt/87813/6 "2022-09-28T12:24:33Z")

</div>

No, then it would be trivial why we have different running times.
