nushell / nushell

A new type of shell
https://www.nushell.sh/
MIT License
31.69k stars 1.63k forks source link

slow startup (4s) #13839

Open adrianstaniec opened 4 days ago

adrianstaniec commented 4 days ago

Describe the bug

start nu shell, wait for prompt

How to reproduce

if I run nu -n --log-level trace it takes more than 4s here is the longest iterm from the trace

2024-09-13 12:28:06.782 PM [INFO ] nu_cli::repl: perf: /home/adrian/.cargo/registry/src/index.crates.io-6f17d22bba15001f/nu-cli-0.97.1/src/repl.rs:241:5 setup reedline took 4.058367546s

it also prints a LOT of these (with different endings):

2024-09-13 12:28:02.663 PM [TRACE] nu_parser::parser: [/home/adrian/.cargo/registry/src/index.crates.io-6f17d22bba15001f/nu-parser-0.97.1/src/parser.rs:1596] parsing: 

Expected behavior

prompt appearing in less than 1s

Configuration

key value
version 0.97.1
major 0
minor 97
patch 1
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.81.0 (eeb90cda1 2024-09-04)
rust_channel stable-x86_64-unknown-linux-gnu
cargo_version cargo 1.81.0 (2dbb1af80 2024-08-20)
build_time 2024-09-13 13:54:38 +02:00
build_rust_channel release
allocator mimalloc
features default, sqlite, system-clipboard, trash
installed_plugins
fdncred commented 4 days ago

I believe this has been already fixed because we removed a feature dealing with the clipboard which is what I believe is causing your slow startup. You might try the latest main to see if it behaves differently.

hustcer commented 4 days ago

@adrianstaniec You can also try the latest nightly builds here: https://github.com/nushell/nightly/releases/tag/nightly-5101b5e

j-xella commented 1 day ago

I believe this has been already fixed because we removed a feature dealing with the clipboard which is what I believe is causing your slow startup

In that case (#13019 ) it took nushell ~2 minutes (!!!) to start, here it is just 4 seconds. Could something else be at play?

Also the previous issue (at least in my case) used to be due to a broken X-server connection, one workaround being unsetting the DISPLAY environment variable before starting nu shell. Would that help here?

adrianstaniec commented 1 day ago

I am not sure, why but I can't install the nightly version. I will happily test is when it that version is released.

adrianstaniec commented 1 day ago

I have some new observations: I saw that it's only slow when I have another putty ssh session open to the same linux machine. Otherwise it starts up instantly. any ideas?