Verdict#
Question |
Verdict |
|---|---|
Safer than permanent
|
Yes — recoverable FreeDesktop trash + rm fail-safes |
Safer than trash-cli? |
Roughly equivalent FreeDesktop correctness; stronger rm-flag fail-safes on put |
Better as a daily driver for this niche? |
Yes for native multi-call + in-process Python |
Faster? |
Yes on the measured fixtures (see dated table; not universal) |
Reproduce#
cargo build --release
export RTRASH_BIN=$PWD/target/release/rtrash
# Real Python trash-cli (not multi-call rtrash on PATH):
export TRASH_CLI_BIN_DIR=$PWD/.venv-bench/bin
python3 benches/compare_trash_cli.py | tee compare-trash-cli.log
Fixture: 400 small files + multi-file directory tree; two trials; put
then empty with --trash-dir pin. Harness rejects trash-put when
it is multi-call rtrash.
Measured results (Linux x8664, 2026-07-08)#
Tool |
put avg (s) |
empty avg (s) |
|---|---|---|
rtrash 0.1.2 release |
0.005449 |
0.002986 |
trash-cli 0.24.5.26 |
0.074310 |
0.039565 |
speedup |
~13.6× |
~13.3× |
Both tools: ec=0, entries=401 after put, empty leaves
files_left=0 info_left=0, LIST_OK for a single-file put.
Optional peers trashy/gtrash: missing on the host. Earlier 2026-07-07
snapshot (~13× / ~12×) superseded by the 2026-07-08 table.
du against dua, gdu and du (Linux x8664, 2026-10-13)#
rtrash du ranks directories and files and tags artefacts and git
state, so it does more per run than dua aggregate, gdu -n -p or
du -s, which print totals. Warm page cache, 8 CPUs, ext4-family root
file system, hyperfine -N --warmup 2 --runs 8.
Tree |
rtrash du |
dua 2.45.1 aggregate |
gdu (static) -n -p |
GNU du -s |
|---|---|---|---|---|
synthetic: 400,000 files in 2,041 directories (1.31 GiB on disk) |
69.9 ± 9.2 ms |
1025.9 ± 48.3 ms |
156.1 ± 8.6 ms |
370.6 ± 17.0 ms |
~/.cargo/registry/src (1.4 GiB) |
38.0 ± 3.7 ms |
338.3 ± 19.4 ms |
75.6 ± 4.7 ms |
129.0 ± 4.3 ms |
All four agree on the synthetic tree’s disk use (1.31 GiB). More dua
threads (-t 8, -t 24) and gdu -m 8 did not change their
times. Memory: rtrash 5 MiB, dua 4 MiB, gdu 26 to 41 MiB, du 2 MiB. A
cold cache was not measured (no root on the build host to drop caches).
Reproduce:
cargo build --release
benches/compare_du.sh target/release/rtrash /path/to/tree ~/.cargo/registry/src
One wide directory (2026-10-14)#
A single directory with 224,985 files of 100 bytes each and no
subdirectories, warm page cache, same host,
hyperfine -N --warmup 1 --runs 5. The file creation slowed as the
directory grew on this host, so the run stopped short of the planned
million entries.
rtrash du |
dua 2.45.1 aggregate |
gdu 5.38.0 -n -p |
GNU du -s |
|---|---|---|---|
70.4 ms |
1.233 s |
542.7 ms |
236.6 ms |
rtrash du reports 882.3 MiB on disk, the same as du -sB1; dua
leaves out the directory’s own blocks (878.84 MiB). The older dua 2.32.0
took 78.8 s on the same directory. The wide directory takes the parallel
stat path of rtrash du (above 256 entries, in chunks of 64).
Duplicate finder (2026-10-14)#
rtrash du --dupes --json ~/.cargo/registry over 76,074 files, warm
page cache, 8 cores, six runs: 0.25 to 0.29 s (median 0.26 s). It finds
8,627 groups with 18,160 extra copies and 158 MiB to free. Trash
directories are skipped, which costs one lstat per directory when a home
trash exists.
Trash inode count (2026-10-14)#
A trash of 100,100 items on tmpfs (100,000 files and 100 directories of
110 entries), 8 cores, release build. trash-stats --total --json
gives 211,200 inodes.
Case |
Time |
|---|---|
first count with |
0.59 s |
recount after a change to |
0.16 s |
unchanged trash (stored answer line) |
0.001 s |
A recount reads files/ once and stats each record; it walks no tree.
One million files on tmpfs (2026-10-14)#
A tree of 1,000 directories with 1,000 files each (0 to 600 bytes) in
/dev/shm, 8 cores, release build, one run each. Tmpfs has no backing
store, so these runs never read a disk.
Command |
Time |
|---|---|
|
0.25 s |
|
0.21 s |
|
3.00 s |
|
0.75 s |
|
0.26 s |
|
3.29 s |
Cold page cache (2026-10-14)#
A tree of 200,000 files in 200 directories on ext4 over virtio
(/dev/vdb), 8 cores, one run each; a cold run follows
echo 3 > /proc/sys/vm/drop_caches.
Command |
Cold |
Warm |
|---|---|---|
|
0.18 s |
0.04 s |
|
0.17 s |
0.03 s |
|
1.74 s |
0.57 s |
|
0.008 s |
|
|
1.45 s |