Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REPL keyboard input lag at start up #35644

Open
MFairley opened this issue Apr 29, 2020 · 4 comments
Open

REPL keyboard input lag at start up #35644

MFairley opened this issue Apr 29, 2020 · 4 comments
Labels
compiler:latency Compiler latency

Comments

@MFairley
Copy link

julia version 1.4.1
macOS 10.15.4

I have an issue where if either Revise or OhMyREPL are loaded at start up then the Julia REPL cannot accept keyboard input quickly after displaying Julia> for ~2 seconds. If I type something as soon as the prompt displays then it will appear after about ~2 seconds. It's irritating because it appears that the REPL should accept inputs but has an obvious lag.

My startup.jl file is as follows

atreplinit() do repl
    @async try
        sleep(0.1)
        @eval using Revise
        @async Revise.wait_steal_repl_backend()
    catch
        @warn("Could not load Revise.")
    end
end

atreplinit() do repl
    try
        @eval using OhMyREPL
        @eval enable_autocomplete_brackets(false)
    catch e
        @warn "error while importing OhMyREPL" e
    end
end

If I comment out both of these then the issue goes away. Either one of them by themselves will cause the issue.

@KristofferC
Copy link
Sponsor Member

That's just normal loading time from loading packages. You can look at https://julialang.github.io/PackageCompiler.jl/dev/examples/ohmyrepl/ for a technique on how to get rid of it.

@MFairley
Copy link
Author

Thanks. I don't remember having the issue before. Shouldn't Julia hold back from displaying the prompt until it is ready to accept input?

@KristofferC
Copy link
Sponsor Member

In the case of OhMyREPL it isn't until a key is pressed that a lot of code is getting compiled.

@MFairley
Copy link
Author

Got it, although I have the same issue with only Revise too.

@JeffBezanson JeffBezanson added the compiler:latency Compiler latency label Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:latency Compiler latency
Projects
None yet
Development

No branches or pull requests

3 participants