Skip to content

default to num logical cpus rather than 4 threads #81

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ crossbeam = "0.8.2"
filesize = "0.2.0"
ignore = "0.4.2"
lscolors = { version = "0.13.0", features = ["ansi_term"] }
num_cpus = "1.15.0"
once_cell = "1.17.0"

[dev-dependencies]
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ A modern, vibrant, and multi-threaded file-tree visualizer and disk usage analyz
If the chosen defaults don't meet your requirements and you don't want to bloat your shell configs with aliases, you can use a [configuration file](#configuration-file) instead.

## Usage

**Note**: The amount of threads used by default is dependent upon how many logical CPUs available in your system.

```
erdtree (et) is a multi-threaded filetree visualizer and disk usage analyzer.

Expand All @@ -75,7 +78,7 @@ Options:
-s, --sort <SORT> Sort-order to display directory content [possible values: name, size, size-rev]
--dirs-first Always sorts directories above files
-S, --follow-links Traverse symlink directories and consider their disk usage; disabled by default
-t, --threads <THREADS> Number of threads to use [default: 4]
-t, --threads <THREADS> Number of threads to use [default: 10]
--suppress-size Omit disk usage from output; disabled by default
--size-left Show the size on the left, decimal aligned
--no-config Don't read configuration file
Expand Down
4 changes: 2 additions & 2 deletions src/render/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ pub struct Context {
#[arg(short = 'S', long)]
pub follow_links: bool,

/// Number of threads to use
#[arg(short, long, default_value_t = 4)]
/// Number of threads to use; defaults to number of logical cores available
#[arg(short, long, default_value_t = num_cpus::get())]
pub threads: usize,

/// Omit disk usage from output; disabled by default
Expand Down