julia-intellij icon indicating copy to clipboard operation
julia-intellij copied to clipboard

Execution using run is very slow

Open edbaskerville opened this issue 4 years ago • 5 comments

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 .

edbaskerville avatar Oct 10 '19 21:10 edbaskerville

I have no idea, but you can see the execution command in the execution window, you can check if the arguments are set properly.

ice1000 avatar Oct 11 '19 16:10 ice1000

Can confirm with:

  • Julia 1.1
  • OSX 10.14.6
  • PyCharm 2019.2.3
  • Julia plugin 0.4.0

mattBrzezinski avatar Oct 31 '19 19:10 mattBrzezinski

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?

kaieberl avatar Aug 06 '22 14:08 kaieberl

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'?

ice1000 avatar Aug 07 '22 06:08 ice1000

I am aware of that option, but it would be nice if something like that would be implemented under the run option.

kaieberl avatar Aug 07 '22 07:08 kaieberl