nushell / nushell/reedline

Perf issue: scrolling in the completion menu keeps triggering (re)parsing of the command line over and over

Open
#885 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-Completions A-Performance bug P-low
Dominant language
Rust
Stars
818
Forks
249
Avg merge
4d 14h
Merged PRs (30d)
30

Description

Platform macOS
Terminal software ghostty

Found this issue during https://github.com/nushell/nushell/pull/15270

Steps to reproduce

  1. type in use std <tab>
  2. hold ctrl-p/ctrl-n down for a while

rustc optimized nu release performs noticeably better.

Basically the menu next/prev event will trigger the parsing of the cli, which involves dozens of parse_module_file calls.

I guess it has something to do with the highlighting. But since the cli text doesn't change by those events (maybe I missed some config here to make it happen), I think it should be optimized.

Typing in cli after use std is also not very responsive due to the same reason, but that is probably harder to fix.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce with use std <tab> and held ctrl-p/ctrl-n in an optimized Rust release. Trace the menu next/prev event through highlighting and the repeated parse_module_file calls. Done means navigating the completion menu no longer reparses unchanged CLI text repeatedly and scrolling is responsive.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.