You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A modern, vibrant, and multi-threaded file-tree visualizer and disk usage analyzer that respects hidden files and `.gitignore` rules by default i.e. the secret love child of [tree](https://en.wikipedia.org/wiki/Tree_(command)) and [du](https://en.wikipedia.org/wiki/Du_(Unix)).
8
+
A modern, multi-threaded file-tree visualization and disk usage analysis tool that respects hidden file and `.gitignore` i.e. the secret love child of [tree](https://en.wikipedia.org/wiki/Tree_(command)) and [du](https://en.wikipedia.org/wiki/Du_(Unix)).
9
9
10
10
<palign="center">
11
11
<imgsrc="https://github.com/solidiquis/erdtree/blob/master/assets/demo.png?raw=true"alt="failed to load picture" />
@@ -22,6 +22,7 @@ A modern, vibrant, and multi-threaded file-tree visualizer and disk usage analyz
22
22
*[Installation](#installation)
23
23
*[Info](#info)
24
24
-[Configuration file](#configuration-file)
25
+
-[Parallelism](#parallelism)
25
26
-[Binary prefix or SI prefix](#binary-prefix-or-si-prefix)
26
27
-[Logical or physical disk usage](#logical-or-physical-disk-usage)
27
28
-[How are directory sizes computed](#how-are-directory-sizes-computed)
@@ -54,8 +55,6 @@ If the chosen defaults don't meet your requirements and you don't want to bloat
54
55
55
56
## Usage
56
57
57
-
**Note**: The amount of threads used by default is dependent upon how many logical CPUs available in your system.
58
-
59
58
```
60
59
erdtree (et) is a multi-threaded filetree visualizer and disk usage analyzer.
61
60
@@ -158,15 +157,37 @@ Arguments passed to `erdtree` take precedence. If you have a config that you wou
158
157
Here is an example of a valid config:
159
158
160
159
```
161
-
$ cat $HOME/.erdtreerc
162
-
--level 2
160
+
$ cat $HOME/.config/erdtree/.erdtreerc
161
+
# Long or short names work
162
+
-s size
163
+
164
+
# I prefer physical size
165
+
--disk-usage physical
166
+
167
+
# ooo pwetty
163
168
--icons
164
-
--scale 3
165
169
166
-
# You can use the short names too
167
-
-s size
170
+
# This is prettier.. thanks bryceberger
171
+
--size-left
172
+
--prune
168
173
```
169
174
175
+
### Parallelism
176
+
177
+
A common question people have about `erdtree` is how it benefits from parallelism when disk I/O does serial processing, i.e. it can only ever service one request at a time.
178
+
179
+
The idea behind leveraging parallelism for disk reads is that despite serial processing you'll still get higher throughput as saturating the disk queue depth with user-space requests allows it to process requests in aggregate rather than waiting for a single-thread to send a single request at a time and doing some CPU-bound work with the response before sending another.
180
+
181
+
Here are some crude benchmarks demonstrating the relationship between performance and thread-count.
182
+
183
+
<palign="center">
184
+
<imgsrc="https://github.com/solidiquis/erdtree/blob/master/assets/thread_performance.png?raw=true"alt="failed to load png" />
185
+
</p>
186
+
187
+
It's important to note that some parallelism does improve performance but after a certain threshold you do get dimishing returns. As [Amdahl's law](https://en.wikipedia.org/wiki/Amdahl%27s_law) suggests, there is an asymptotic threshold for the speedup which is a function of thread-count. Once you've approached that threshold you're just paying the additional cost of managing a larger thread-pool with no added benefit.
188
+
189
+
If you'd like more rigorous empirical data going into how parallelism benefits both SSD and HDD checkout [this article](https://pkolaczk.github.io/disk-parallelism/).
190
+
170
191
### Binary prefix or SI Prefix
171
192
172
193
Disk usage is reported using binary prefixes by default (e.g. `1 KiB = 1024 B`) as opposed to SI prefixes (`1 KB = 1000 B`). To toggle between the two use the `-p, --prefix` option.
0 commit comments