# Run times of julia much slower in juno than in terminal

**URL:** <https://discourse.julialang.org/t/run-times-of-julia-much-slower-in-juno-than-in-terminal/17908>\
**Category:** Juno\
**Created:** [November 23, 2018, 2:41pm UTC](https://discourse.julialang.org/t/run-times-of-julia-much-slower-in-juno-than-in-terminal/17908 "2018-11-23T14:41:05Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidzentlermunro](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidzentlermunro/32/5967_2.png) [@davidzentlermunro](https://discourse.julialang.org/u/davidzentlermunro)\
**Post date:** [November 23, 2018, 2:41pm UTC](https://discourse.julialang.org/t/run-times-of-julia-much-slower-in-juno-than-in-terminal/17908/1 "2018-11-23T14:41:06Z")

</div>

I’m finding that when I run my code in juno, it takes significantly longer than when run on the terminal. I’m running an optimization routine which gets slower and slower as the evaluations increase (on juno, not terminal). is this to be expected?

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [November 23, 2018, 3:33pm UTC](https://discourse.julialang.org/t/run-times-of-julia-much-slower-in-juno-than-in-terminal/17908/2 "2018-11-23T15:33:01Z")

</div>

No, this is definitely not expected.  
Can you share the code you’re running and also how you’re running it in Juno and the REPL respectively?

---

<div class="post-metadata">

**Author:** ![ssfrr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ssfrr/32/3736_2.png) [@ssfrr](https://discourse.julialang.org/u/ssfrr)\
**Post date:** [November 23, 2018, 6:45pm UTC](https://discourse.julialang.org/t/run-times-of-julia-much-slower-in-juno-than-in-terminal/17908/3 "2018-11-23T18:45:24Z")

</div>

Also include your versions of the Julia and Atom packages. A while ago (maybe a year?) there was a similar issue that was caused by Atom’s high CPU usage rendering animations, but that should no longer be the case.

---

<div class="post-metadata">

**Author:** ![davidzentlermunro](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidzentlermunro/32/5967_2.png) [@davidzentlermunro](https://discourse.julialang.org/u/davidzentlermunro)\
**Post date:** [November 26, 2018, 11:04am UTC](https://discourse.julialang.org/t/run-times-of-julia-much-slower-in-juno-than-in-terminal/17908/4 "2018-11-26T11:04:48Z")

</div>

Julia v1.0.1, and atom 1.32.2.

Here’s my rather messy code - appreciate this isn’t exactly a minimum working example though…!

[https://github.com/davidzentlermunro/Minimum-Wage-Paper/blob/master/ModelCapSkillComp\_fcalibSMM\_frictions\_imperfectsubs\_beta\_dist.jl](https://github.com/davidzentlermunro/Minimum-Wage-Paper/blob/master/ModelCapSkillComp_fcalibSMM_frictions_imperfectsubs_beta_dist.jl)

I run it on terminal via the “include” command and on atom by running the file (though even if I use" include" command within julia on atom I get the same thing - significantly slower run time.

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [November 26, 2018, 11:53am UTC](https://discourse.julialang.org/t/run-times-of-julia-much-slower-in-juno-than-in-terminal/17908/5 "2018-11-26T11:53:08Z")

</div>

I think I can reproduce the performance difference in Juno vs a normal REPL. Can you try executing

```julia
using Logging; Logging.global_logger(Logging.NullLogger())

```

before executing the file (both in Juno and the REPL)?  
Timings seem to be en par after that for me.

---

<div class="post-metadata">

**Author:** ![davidzentlermunro](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidzentlermunro/32/5967_2.png) [@davidzentlermunro](https://discourse.julialang.org/u/davidzentlermunro)\
**Post date:** [November 27, 2018, 6:18pm UTC](https://discourse.julialang.org/t/run-times-of-julia-much-slower-in-juno-than-in-terminal/17908/6 "2018-11-27T18:18:04Z")

</div>

Yes thanks that works well. It’s be bugging me for a while - I should have asked sooner! Do I need to run it everytime I run any code with an optimizer?

---

<div class="post-metadata">

**Author:** ![Juan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juan/32/7657_2.png) [@Juan](https://discourse.julialang.org/u/Juan)\
**Post date:** [November 28, 2018, 1:48am UTC](https://discourse.julialang.org/t/run-times-of-julia-much-slower-in-juno-than-in-terminal/17908/7 "2018-11-28T01:48:16Z")

</div>

Is this tip only applicable to Juno or also to other GUI frontends?

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [November 29, 2018, 9:21am UTC](https://discourse.julialang.org/t/run-times-of-julia-much-slower-in-juno-than-in-terminal/17908/8 "2018-11-29T09:21:43Z")

</div>

> [@davidzentlermunro](#):
>
> Do I need to run it everytime I run any code with an optimizer?

Once per session is enough. I’m not sure what the root cause is, but I think this happens because of a performance problem in Base combined with Juno processing log events.

> [@Juan](#):
>
> Is this tip only applicable to Juno or also to other GUI frontends?

Depends on the internals of said GUI frontend 🙂 If there’s nontrivial log event handling going on then it might help, yes. If in doubt, try it.

---

<div class="post-metadata">

**Author:** ![davidzentlermunro](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidzentlermunro/32/5967_2.png) [@davidzentlermunro](https://discourse.julialang.org/u/davidzentlermunro)\
**Post date:** [February 8, 2019, 4:27pm UTC](https://discourse.julialang.org/t/run-times-of-julia-much-slower-in-juno-than-in-terminal/17908/9 "2019-02-08T16:27:26Z")

</div>

Note that I’ve just looked at this again: while using this tip does reduce the discrepancy I’m still finding that running code in terminal is a lot (4-5 times) faster than in atom.

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [February 8, 2019, 5:08pm UTC](https://discourse.julialang.org/t/run-times-of-julia-much-slower-in-juno-than-in-terminal/17908/10 "2019-02-08T17:08:12Z")

</div>

Can you try profiling your code to figure out what’s taking more time in Juno? Is there some code for me to try and reproduce the slowdowns?

---

<div class="post-metadata">

**Author:** ![davidzentlermunro](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidzentlermunro/32/5967_2.png) [@davidzentlermunro](https://discourse.julialang.org/u/davidzentlermunro)\
**Post date:** [February 15, 2019, 3:30pm UTC](https://discourse.julialang.org/t/run-times-of-julia-much-slower-in-juno-than-in-terminal/17908/11 "2019-02-15T15:30:45Z")

</div>

The bit that’s for sure taking a lot more time is the running of an optimizer, though when isolate this to try and construct a mwe the difference disappears. Here’s a link to the full code I’ve been using and encountering this problem in: [https://github.com/davidzentlermunro/Capital-Skill-Complementarity](https://github.com/davidzentlermunro/Capital-Skill-Complementarity)

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [February 15, 2019, 3:58pm UTC](https://discourse.julialang.org/t/run-times-of-julia-much-slower-in-juno-than-in-terminal/17908/12 "2019-02-15T15:58:07Z")

</div>

You have some data in directories not in that git repo (`/Users/davidzentlermunro/OneDrive/KORV with frictions/Data/` etc).  
Would also be interesting to know which part of the code is slow or if it is executing the whole file that’s slower.

---

<div class="post-metadata">

**Author:** ![davidzentlermunro](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidzentlermunro/32/5967_2.png) [@davidzentlermunro](https://discourse.julialang.org/u/davidzentlermunro)\
**Post date:** [February 15, 2019, 5:13pm UTC](https://discourse.julialang.org/t/run-times-of-julia-much-slower-in-juno-than-in-terminal/17908/13 "2019-02-15T17:13:26Z")

</div>

All the data files are in the git repo, unless I’m overlooking something: which one do you seem to be missing? It’s the parts of the code that use blackboxoptim that seem to be causing the difficulty.

---

<div class="post-metadata">

**Author:** ![davidzentlermunro](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidzentlermunro/32/5967_2.png) [@davidzentlermunro](https://discourse.julialang.org/u/davidzentlermunro)\
**Post date:** [February 18, 2019, 3:28pm UTC](https://discourse.julialang.org/t/run-times-of-julia-much-slower-in-juno-than-in-terminal/17908/14 "2019-02-18T15:28:38Z")

</div>

I’ve put simpler/less messy code in here: [https://github.com/davidzentlermunro/Capital-Skill-Complementarity/blob/master/KORVestimationv\_latest.jl](https://github.com/davidzentlermunro/Capital-Skill-Complementarity/blob/master/KORVestimationv_latest.jl)

It turns out part of the problem was resolved by closing atom and reopening (even though on several occasions I had killed and restarted julia within atom) but I still get a speed discrepancy vs terminal.
