• Stars
    star
    936
  • Rank 48,823 (Top 1.0 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created about 6 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A minimal, fast alternative to 'du -sh'

diskus

CICD

A minimal, fast alternative to du -sh.

diskus is a very simple program that computes the total size of the current directory. It is a parallelized version of du -sh. On my 8-core laptop, it is about ten times faster than du with a cold disk cache and more than three times faster with a warm disk cache.

> diskus
9.59 GB (9,587,408,896 bytes)

Benchmark

The following benchmarks have been performed with hyperfine on a moderately large folder (15GB, 100k directories, 400k files). Smaller folders are not really of any interest since all programs would finish in a reasonable time that would not interrupt your workflow.

In addition to du and diskus, we also add tin-summer (sn) and dust in our comparison. Both are also written in Rust and provide much more features than diskus (check them out!). The optimal number of threads for sn (-j option) was determined via hyperfine --parameter-scan.

Cold disk cache

sudo -v
hyperfine --prepare 'sync; echo 3 | sudo tee /proc/sys/vm/drop_caches' \
    'diskus' 'du -sh' 'sn p -d0 -j8' 'dust -d0'

(the sudo/sync/drop_caches commands are a way to clear the filesystem caches between benchmarking runs)

Command Mean [s] Min [s] Max [s] Relative
diskus 1.746 ± 0.017 1.728 1.770 1.00
du -sh 17.776 ± 0.549 17.139 18.413 10.18
sn p -d0 -j8 18.094 ± 0.566 17.482 18.579 10.36
dust -d0 21.357 ± 0.328 20.974 21.759 12.23

Warm disk cache

On a warm disk cache, the differences are smaller:

hyperfine --warmup 5 'diskus' 'du -sh' 'sn p -d0 -j8' 'dust -d0'
Command Mean [ms] Min [ms] Max [ms] Relative
diskus 500.3 ± 17.3 472.9 530.6 1.00
du -sh 1098.3 ± 10.0 1087.8 1122.4 2.20
sn p -d0 -j8 1122.2 ± 18.2 1107.3 1170.1 2.24
dust -d0 3532.1 ± 26.4 3490.0 3563.1 7.06

Installation

On Debian-based systems

You can download the latest Debian package from the release page and install it via dpkg:

wget "https://github.com/sharkdp/diskus/releases/download/v0.7.0/diskus_0.7.0_amd64.deb"
sudo dpkg -i diskus_0.7.0_amd64.deb

On Arch-based systems

pacman -S diskus

Or download diskus-bin from the AUR.

On Void-based systems

xbps-install diskus

On macOS

You can install diskus with Homebrew:

brew install diskus

Or with MacPorts:

sudo port install diskus

On Haiku

pkgman install diskus

On NixOS

nix-env -iA nixos.diskus

Or add it to environment.systemPackages in your configuration.nix.

On other systems

Check out the release page for binary builds.

Via cargo

If you have Rust 1.50 or higher, you can install diskus from source via cargo:

cargo install diskus

Windows caveats

Windows-internal tools such as Powershell, Explorer or dir are not respecting hardlinks or junction points when determining the size of a directory. diskus does the same and counts such entries multiple times (on Unix systems, multiple hardlinks to a single file are counted just once).

License

Licensed under either of

at your option.

More Repositories

1

bat

A cat(1) clone with wings.
Rust
48,695
star
2

fd

A simple, fast and user-friendly alternative to 'find'
Rust
33,228
star
3

hyperfine

A command-line benchmarking tool
Rust
18,256
star
4

hexyl

A command-line hex viewer
Rust
8,565
star
5

pastel

A command-line tool to generate, analyze, convert and manipulate colors
Rust
4,746
star
6

insect

High precision scientific calculator with support for physical units
PureScript
3,147
star
7

dbg-macro

A dbg(…) macro for C++
C++
2,719
star
8

cube-composer

A puzzle game inspired by functional programming
PureScript
1,967
star
9

vivid

A themeable LS_COLORS generator with a rich filetype datebase
Rust
1,479
star
10

shell-functools

Functional programming tools for the shell
Python
1,133
star
11

binocle

a graphical tool to visualize binary data
Rust
964
star
12

numbat

A statically typed programming language for scientific computations with first class support for physical dimensions and units
Rust
734
star
13

great-puzzles

A curated list of great puzzles
484
star
14

purescript-flare

A special-purpose UI library for Purescript
PureScript
286
star
15

lscolors

A Rust library and tool to colorize paths using LS_COLORS
Rust
235
star
16

trigger

Run a user-defined command on file changes
Shell
181
star
17

bugreport

Rust library to collect system and environment information for bug reports
Rust
131
star
18

quizzity

A fast-paced geography quiz
JavaScript
125
star
19

curiosity

How far does your curiosity take you?
HTML
99
star
20

lucid

A simple mock-application for programs that work with child processes
Rust
86
star
21

parachuting-robots

An interactive version of a classic puzzle
PureScript
78
star
22

purescript-sparkle

Infer user interfaces from type signatures
PureScript
75
star
23

stack-inspector

A gdb command to inspect the size of objects on the stack
Python
62
star
24

painless

Painless parameter handling for easy exploration
C++
60
star
25

yinsh

A web-based version of the board game Yinsh
Haskell
59
star
26

purescript-isometric

Isometric rendering for PureScript
PureScript
58
star
27

pysh

Python-enhanced bash scripts
Python
58
star
28

purescript-quantities

Physical quantities and units
PureScript
53
star
29

minicpp

A REPL-style development environment for small C++ snippets
Shell
48
star
30

purescript-ctprelude

A Prelude with names from category theory
PureScript
48
star
31

qrnet

A neural network that decrypts QR codes
Python
43
star
32

riffle

A simple terminal pager (as a library)
Rust
41
star
33

config-files

A set of configuration files for vim, zsh, i3, ...
Python
37
star
34

content_inspector

Fast inspection of binary buffers to guess/determine the type of content
Rust
32
star
35

factorization-diagrams

Interactive factorization diagrams
HTML
27
star
36

argmax

Rust library to deal with "argument too long" errors
Rust
20
star
37

vacuum-robot-simulator

Simulation environment for an autonomous robot
Rust
19
star
38

sub

A command-line tool for string substitutions (RustLab 2019 workshop)
Rust
16
star
39

purescript-format

Type-safe, printf-style formatting for PureScript
PureScript
15
star
40

PaperLocator

Citation parsing to quickly access publications
JavaScript
14
star
41

purescript-decimals

Arbitrary precision numbers for PureScript
PureScript
13
star
42

flare-example

Quick start project for purescript-flare
PureScript
11
star
43

fd-benchmarks

Benchmarks for 'fd'
Shell
10
star
44

tinytag

tinytag is a "URL" shortener for your filesystem
Python
10
star
45

purescript-flaredoc

Interactive documentation with Flare
PureScript
8
star
46

phd-thesis

LaTeX sources for my PhD thesis
TeX
7
star
47

level11

7
star
48

GPE-Solver

Split-step solver for the 3D (dipolar) Gross-Pitaevskii equation
C++
7
star
49

Pack-Zack

A tag-based manager for packing lists
CSS
7
star
50

latex-report

A clean and simple LaTeX template for reports
TeX
7
star
51

dp

Personal website about some of my open source projects, board games and mountainbiking.
HTML
5
star
52

cs231n

My solutions to the CS231n assignments
Jupyter Notebook
4
star
53

imdb-ratings

Statistical analysis of my IMDB movie ratings
Jupyter Notebook
3
star
54

purescript-pairs

Datatype and functions for pairs of values
PureScript
3
star
55

zehntausend

A solver for the dice game Zehntausend
Haskell
3
star
56

gnuplot-mm

GnuPlot bindings for Mathematica
Mathematica
2
star
57

talk-moderne-programmiersprachen

JavaScript
2
star
58

rock-paper-scissors

Interactive regex puzzle
HTML
2
star
59

purescript-gametree

Algorithms for two-player zero-sum games
PureScript
2
star
60

snake-factory

A work-in-progress game with monadic parsers and snakes
PureScript
1
star
61

gomoku

Five in a row
PureScript
1
star