fsspec / fsspec/filesystem_spec
`LocalFileSystem.ls()` with `details=False` slow
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.4k
- Forks
- 490
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 38
Description
Hi fsspec developers,
I realized when using a later version of fsspec than the ones from 2023 that the .ls() was super slow. The reason came in in this issue PR: #1479 where always the info is taken for all files
and then thrown away - for a large number of files this can become costly and the detail flag can not be used to reduce work. Before the mentioned PR the os.listdir was used which just list the number of files.
I just wanted to ask if I can open a PR in which thels used the os.listdir again for detail=False and if the path is a file it will just return the path to the file - no much use to call it for a file with not details but should of cours work. And if the details=True the code stays as is?
Let me know what you think.
Best
Frank
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at LocalFileSystem.ls() and compare its current behavior with the os.listdir approach described in the issue and PR #1479. Check both details=False and details=True, including the case where the path is a file. Done means details=False avoids collecting discarded info while details=True retains its existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100