eza-community / eza-community/eza
feat: reduce amount of syscalls
- Dominant language
- Rust
- Stars
- 23.3k
- Forks
- 523
- PR merge metrics
- No merged PRs in 30d
Description
eza version `v0.14.1 [+git]`
## `eza` syscall trace

## `ls` syscall trace

## Info
The folder `./target/debug/deps/` ( example folder , any folder with large number of files ) contains `677` files. ( all numbers based on this folder ).
I tested `multiple` times to `come to this`.
## readlink
`eza` makes `2708` `readlink` syscalls, which all fail. This syscall takes around `50-60%` of the execution time. "ls" checks whether a file is a symbolic link before calling `readlink`, while "eza" does not perform this check. (`ls` as `0` calls)
## getcwd
`eza` calls the `getcwd` syscall `677` times, for every file instead of caching it. (`ls` as `0` calls)
## statx
`eza` calls the `statx` syscall `678` times ,even when it does not need the file stats, which unnecessary.
It is not printing, then why call ? (`ls` as `0` calls)
## write
`eza` writes file individually, without using any buffering
# Summary
`ls` takes `72` syscall and `0.000422` seconds.
`eza` needs `4903` syscall and `0.029659` seconds.
`readlink` , `getcwd` , `statx`, `write` takes around `4700` syscall.
## `eza` takes `70` times more `syscalls` and `time`
Contributor guide
Research direction
The issue names no files or tests; first reproduce the syscall trace against a directory such as target/debug/deps and compare eza with ls. Trace the file traversal, metadata, symlink, working-directory, and output paths, then validate that unnecessary calls are reduced without changing CLI behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, performance
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 32/100