Skip to content

Slow prompt with large variables #5236

@kubouch

Description

@kubouch

Describe the bug

When I have a variable of a significant size (100s megabytes, gigabytes), the REPL update slows down considerably.

How to reproduce

  1. let x = (0..2000000 | each {|i| { foo: $i }})
  2. Press enter to get x
  3. Pres enter again to go to a new REPL line: You'll notice it takes some time now for the prompt to appear

Expected behavior

Not to be so slow with large variables.

Screenshots

No response

Configuration

key value
version 0.61.1
branch
tag
short_commit 76079d5
commit_hash 76079d5
commit_date 2022-04-18 22:28:01 +00:00
build_os linux-x86_64
rust_version rustc 1.60.0 (7737e0b5c 2022-04-04)
rust_channel stable-x86_64-unknown-linux-gnu
cargo_version cargo 1.60.0 (d1fd9fe 2022-03-01)
pkg_version 0.61.1
build_time 2022-04-19 09:04:08 +03:00
build_rust_channel release
features dataframe, default, trash, which, zip
installed_plugins gstat

Additional context

I'm wondering if it's the stack getting cloned somewhere (NuCompleter? prompt_update()?) that causes the slowdown.

Metadata

Metadata

Assignees

No one assigned

    Labels

    category:bugSomething isn't workingdeprecated:optimizationDeprecated: Use the performance label insteadperformanceWork to make nushell quicker and use less resources

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions