Revision e4ec80ff19b51a4cdf6d41da0b15b559f8514c2b authored by Shuhei Kadowaki on 10 January 2024, 16:48:28 UTC, committed by Shuhei Kadowaki on 11 January 2024, 08:56:13 UTC
REPL utilizes inference for smarter completions, but since its inference engine is independent from the native cache and issues like #52763 in `REPLInterpreter`'s inference, sometimes delays can be noticeable during tab/hint-completion, and REPL can even freeze in the worst cases. To address this, the commit allows tab/hint-completion to run asynchronously on a `:default` thread. This approach removes delays in multi-threaded process and prevents REPL hang in extreme cases like #52763. In detail, for tab-completion, completion task simply runs on a separate thread since completion itself does not block anything. For hint-completion however, considering that a stuttering display of hints can be bothersome, when the completion task doesn't conclude within 0.01 sec, we cancel the hint-completion to keep the input in the REPL smooth. There are still some points left open for discussion: - Is it better to allocate a separate thread specifically for REPL completion? I'm not sure if this is even possible though. - Should we make this an optional feature, considering the concern some users might have about reduced thread resources? - For situations where completion hangs or is slow, like in #52763, canceling the completion task to release resources would be ideal. However, my understanding is that there's no safe method to cancel a task, is it correct? - At present, this commit `Threads.@spawn`s at a relatively high level in the completion pipeline. But it might be more effective to `Threads.@spawn` closer to the point where inference is actually invoked, such as in `complete_line` or `repl_eval_ex`.
1 parent 73cdfd8
File | Mode | Size |
---|---|---|
.devcontainer | ||
.github | ||
base | ||
cli | ||
contrib | ||
deps | ||
doc | ||
etc | ||
src | ||
stdlib | ||
test | ||
.buildkite-external-version | -rw-r--r-- | 5 bytes |
.clang-format | -rw-r--r-- | 3.3 KB |
.clangd | -rw-r--r-- | 114 bytes |
.codecov.yml | -rw-r--r-- | 52 bytes |
.git-blame-ignore-revs | -rw-r--r-- | 371 bytes |
.gitattributes | -rw-r--r-- | 65 bytes |
.gitignore | -rw-r--r-- | 523 bytes |
.mailmap | -rw-r--r-- | 12.7 KB |
CITATION.bib | -rw-r--r-- | 513 bytes |
CITATION.cff | -rw-r--r-- | 940 bytes |
CONTRIBUTING.md | -rw-r--r-- | 23.4 KB |
HISTORY.md | -rw-r--r-- | 372.8 KB |
LICENSE.md | -rw-r--r-- | 1.3 KB |
Make.inc | -rw-r--r-- | 55.9 KB |
Makefile | -rw-r--r-- | 30.2 KB |
NEWS.md | -rw-r--r-- | 10.0 KB |
README.md | -rw-r--r-- | 7.4 KB |
THIRDPARTY.md | -rw-r--r-- | 3.9 KB |
VERSION | -rw-r--r-- | 11 bytes |
julia.spdx.json | -rw-r--r-- | 37.8 KB |
pkgimage.mk | -rw-r--r-- | 5.8 KB |
sysimage.mk | -rw-r--r-- | 4.2 KB |
typos.toml | -rw-r--r-- | 78 bytes |
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...