Skip to content

Hints on 1.11 slow down REPL text entry #58153

@urbainvaes

Description

@urbainvaes

Apologies in advance for the somewhat vague nature of this question. The reason for the issue described below may not be entirely due to Julia, but what is sure is that recent changes in Julia made it apparent.

The issue: with previous versions of Julia, I could programmatically feed chunks of code, from a Neovim buffer containing Julia code to a Julia REPL running inside a Neovim terminal, using either the chansend() function or the put command in vimscript. There are various plugins to automate this, for example my own, but the issue is not limited to a particular plugin.

With the most recent version of Julia (edit ≥ 1.11.0), the reliability of this workflow (either with chansend() or put) has degraded significantly: code sent programmatically to the Julia REPL takes a long time to run (as if the REPL was copy/pasting the lines one by one, with a small time delay between each line), and the indentation is sometimes all jumbled. What is very strange is that, if I manually copy and paste a block of code, then the REPL behaves as it previously did — the REPL runs fast and the indentation is correct.

Here is a minimal working example to reproduce this issue.

  • Create file test.vim with the following content:
let script =<<EOF
using TickTock
# Discard compilation time
tick(); tock();
tick()
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
a = "a somewhat long line of code, made a bit longer, and again a bit longer"
tock()

EOF

vsplit | term julia
call chansend(&channel, script)
startinsert
  • Open the file in Neovim without any plugins: nvim -u NONE test.vim
  • From within Neovim, run :source %. This will open a Julia REPL in a Neovim terminal, and run the script contained in the variable script in that terminal.

Result: In Julia LTS, this takes less than 100ms, but in Julia Release, it sometimes takes more than 2 seconds.

How can I restore the previous behavior of the REPL?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions