Repository navigation
Description
Describe the bug
The command above does not stream a table of output to autoview, but the user must keep waiting around until the table is fully complete. That is a downgrade from a shell like bash, where you don't have to wait for all the data to finish loading before you can read it.
How to reproduce
- Open a relatively large directory
- Open Nushell and type
ls **/* - You have to wait for a period of time before you see anything
Expected behavior
I expected the ls **/* command to stream output as advertised in the README. However, it doesn't stream output for large files and the user is stuck without even a progress bar.
Screenshots
It almost feels frozen for a long time. It should output a table that keeps updating, rather than this lazy stream. Also if you pipe to fzf, you have to wait for the stream to complete before you see any file.
Configuration
| key | value |
|---|---|
| version | 0.66.3 |
| branch | |
| commit_hash | 5f11be6 |
| build_os | windows-x86_64 |
| build_target | x86_64-pc-windows-msvc |
| rust_version | rustc 1.62.1 (e092d0b6b 2022-07-16) |
| rust_channel | stable-x86_64-pc-windows-msvc |
| cargo_version | cargo 1.62.1 (a748cf5a3 2022-06-08) |
| pkg_version | 0.66.3 |
| build_time | 2022-07-28 23:20:39 +00:00 |
| build_rust_channel | release |
| features | database, dataframe, default, trash, which, zip |
| installed_plugins |
Additional context
This isn't scalable. If the user happens to be in the home directory, it could take longer than a minute for anything to appear at all. It really takes a disproportionately large period of time.
Autoview should be smart. It should page the table when it finally arrives and should keep it to a consistent width. Commands like fzf should recieve a list of increasing size, but shouldn't make you have to wait to start searching.

Activity
kubouch commentedon Jul 29, 2022
Does it still happen? We reverted the
lschanges that likely caused this.wmstack commentedon Jul 29, 2022
Yup, I reported it today, and it happened today.
0.66.1is the latest version right?kubouch commentedon Jul 29, 2022
0.66.2, we made another hotfix.wmstack commentedon Jul 29, 2022
Hmm, I wouldn't be able to run it right now, because it would need to trickle down into scoop. I have installed ripgrep as
rg --fileskind of does the streaming as I want anyway. Still, would love some polish on nushell.Edit: I realized that the update had reached

scoop. I have updated it to0.66.2. Still frozen when I run it:Even running
ls **/*by itself still makes it remain frozen. Just in case you hypothesize thatto textbreaks the streaming.kubouch commentedon Jul 29, 2022
On my end, running
ls **/*streams while previously it waited first. So it seems to me the issues is solved.And yes,
to textcollects the stream.I'll close this issue then but we can discuss the stream collecting in general in another issue (maybe there is one already).
wmstack commentedon Jul 29, 2022
ls **/*is streaming when I do it from my desktop, but when I do it for the home directory, it is frozen:Perhaps because the files that
lstries to read might be open in other programs for the home directory, while those files in the desktop directory are most likely not to be open in an external program.Edit: It is streaming, but takes a long time to start streaming (about 40s).
wmstack commentedon Jul 29, 2022
@kubouch is there a chance that the starting performance for large directories such as the home directory might be improved? I do not need to wait for
rg --fileto start the stream, even for the home directory. However, Nushell currently takes about 40s to start streaming.kubouch commentedon Jul 29, 2022
I'm not sure why you're seeing the 40s pause. For me on Linux, it starts streaming immediately. I'll reopen this until we find a cause of this.
Can you update the version in the issue description to the
0.66.2?wmstack commentedon Jul 29, 2022
It is odd that
scoopsays I have version0.66.2whileversionoutputs0.66.3:)kubouch commentedon Jul 30, 2022
Yeah, somehow the versions got messed up with the recent hotfixes. 0.67.0 comes 16th of August so that's when the versions should match again, at the latest.
rgwood commentedon Dec 9, 2022
FWIW I can't reproduce the 40s delay or anything like it (v0.72, Linux, tried on a few different machines).
Nu currently streams in pages of 1000 records each, so maybe it's getting stuck somewhere in your first 1000 files...
edit: I can reproduce this on Windows. Taking a look....
rgwood commentedon Dec 9, 2022
OK, I can reproduce this on Windows - there is a delay of 5-10s before getting any results from
ls **/*when called in my home directory. If I profilenu -c "cd ~; ls **/* | first 20"in Superluminal, I can see that a tremendous amount of time is spent instd::sys::windows::fs::metadata:From what I can tell, Nu is spending that time gathering file metadata for a lot of files instead of just the first 20. This doesn't quite fit my understanding of how Nu's iterators/streams work, so my understanding of them is probably wrong.
rgwood commentedon Dec 9, 2022
Alright, my current rough understanding:
**/*,nu_globcan look at many files before returning a resultnu_globneeds to check file metadata usingfs::metadataNot easy to improve without a deep dive into the globbing code. I'm going to leave this here for now.
cosineblast commentedon Dec 18, 2024
I can note a smaller-scale version of this problem even on linux. Having more than 90k files in a directory makes so that
ls **/*takes at least 500 milliseconds to produce any results.Although it takes less than one-second, it is still annoying with things like
fzf, specially since the cold start scales linearly with the number of files under your home directory.`ls` now collects metadata in a separate thread (#14627)