Run times of julia much slower in juno than in terminal


#1

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?


#2

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?


#3

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.


#4

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…!

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.


#5

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

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.


#6

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?


#7

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


#8

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.

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


#9

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.


#10

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?


#11

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


#12

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.


#13

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.