Skip to content

Commit b2b9fb9

Browse files
committed
- Update README with benchmark results
- Update demo
1 parent 30a20c8 commit b2b9fb9

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

README.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Options:
4343
-x, --threads <THREADS>
4444
Number of threads to use when calibrating and scanning [default: 24]
4545
-p, --updates <UPDATES>
46-
Seconds between status updates, set to 0 to disable [default: 60]
46+
Seconds between status updates, set to 0 to disable [default: 20]
4747
-i, --size-inode-ratio <SIZE_INODE_RATIO>
4848
Skip calibration and provide directory entry to inode size ratio (typically ~21-32) [default: 0]
4949
-t, --calibration-path <CALIBRATION_PATH>
@@ -63,3 +63,33 @@ To avoid descending into mounted filesystems (as in find -xdev option), paramete
6363
It is possible to completely skip calibration phase by manually providing directory inode size to number of entries ratio with `-i` parameter. It makes sense only when you already know the ratio, for example from previous runs.
6464

6565
Setting `-p` paramter to 0 will stop program from giving occasional status updates.
66+
67+
## Benchmarks
68+
69+
### Findlargedir vs GNU find
70+
71+
Benchmark setup:
72+
73+
```shell
74+
$ cat bench1.sh
75+
#!/bin/sh
76+
find / -xdev -type d -size +200000c
77+
78+
$ cat bench2.sh
79+
#!/bin/sh
80+
/usr/local/sbin/findlargedir /
81+
```
82+
83+
Actual results:
84+
85+
```shell
86+
$ hyperfine --prepare 'echo 3 | tee /proc/sys/vm/drop_caches' ./bench1.sh ./bench2.sh
87+
88+
Benchmark 1: ./bench1.sh
89+
Time (mean ± σ): 216.122 s ± 1.118 s [User: 1.707 s, System: 10.359 s]
90+
Range (min … max): 214.701 s … 217.845 s 10 runs
91+
92+
Benchmark 1: ./bench2.sh
93+
Time (mean ± σ): 120.427 s ± 1.978 s [User: 45.438 s, System: 92.729 s]
94+
Range (min … max): 116.673 s … 123.187 s 10 runs
95+
```

demo.gif

-1.6 MB
Loading

0 commit comments

Comments
 (0)