Skip to content

nu freezes with 100% CPU usage when dealing with a huge structure #6979

@rapenne-s

Description

@rapenne-s

Describe the bug

hi, I'm trying to parse a huge json generated from Nix with nu 0.70.0

The following command fails, nu process is stuck at 100% CPU and its memory usage doesn't change over time.

nix search --json nixpkgs | from json | transpose key value

Parsing the json itself is fine, nix search --json nixpkgs | from json doesn't freeze, but trying to apply something like | first 10 on it also freeze.

How to reproduce

By generating the data:

  1. You need nix installed:
  2. nix search --json nixpkgs | from json | transpose key value

By using a pre-generated file:

  1. Get the file file.json.gz
  2. run gunzip on it
  3. open file.json | from json | transpose key value

Expected behavior

it gives a result instead of freezing

Screenshots

No response

Configuration

key value
version 0.70.0
branch
commit_hash
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.64.0
cargo_version cargo 1.64.0
pkg_version 0.70.0
build_time 1980-01-01 00:00:00 +00:00
build_rust_channel release
features database, dataframe, default, trash, which, zip
installed_plugins

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    performanceWork to make nushell quicker and use less resources

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions