julia-intellij
julia-intellij copied to clipboard
Execution using run is very slow
I'm seeing very slow execution times when running scripts inside the Julia IntelliJ plugin—only when using "Run". ("Send file to REPL" is fast.)
E.g., this file runs in about 0.06 seconds if I run it using julia script.jl
in my terminal:
using Dates
function main()
wallclock_start = now()
print("starting at ", wallclock_start, "\n")
x = 1
for i in 1:100000000
x += 1
end
wallclock_end = now()
print("ending at ", wallclock_end, "\n")
elapsed_time = Dates.value(wallclock_end - wallclock_start) / 1000.0
print("elapsed time: ", elapsed_time, " seconds")
end
main()
but it takes 6 seconds when using Run with the plugin.
This is Julia 1.2 / Mac OS X 10.14.5 / PyCharm 2019.2.3 / Julia plugin 0.4.0 .
I have no idea, but you can see the execution command in the execution window, you can check if the arguments are set properly.
Can confirm with:
- Julia 1.1
- OSX 10.14.6
- PyCharm 2019.2.3
- Julia plugin 0.4.0
As far as I understand, it is slow because for every run, a new Julia instance is started, which takes time to compile. Is there a way to just use the previously opened REPL and just clean the variables before?
As far as I understand, it is slow because for every run, a new Julia instance is started, which takes time to compile. Is there a way to just use the previously opened REPL and just clean the variables before?
Maybe you can 'send code to REPL'?
I am aware of that option, but it would be nice if something like that would be implemented under the run option.