A simple disk benchmark tool.

Overview

simple-disk-benchmark

A simple disk benchmark tool.

Alt text

Operating Systems

Currently, macOS and Linux are tested. Windows may work but is not tested. Development is on macOS.

Installation

cargo install simple-disk-benchmark

Usage

A simple disk benchmark tool

Usage: simple-disk-benchmark [OPTIONS] [FILE]

Arguments:
  [FILE]  File to use for benchmarking. If this file exists it will be deleted [default: testfile.dat]

Options:
  -s, --size <FILESIZE>         Size of the file to use for benchmarking [default: 1GB]
  -b, --blocksize <BLOCK_SIZE>  Size of the blocks to read/write [default: 128MB]
  -c, --cycles <CYCLES>         Number of test cycles to run [default: 10]
  -m, --mode <MODE>             Types of test to run: read, write or all [default: all] [possible values: all, read, write]
  -r, --random-seek             Seek to a random position in the file before each read/write
      --no-create               Do not create the test file, the file must already exist
      --no-delete               Do not delete the test file after the test
      --no-progress             Do not display progress bar
      --no-disable-cache        Do not disable the file system cache
      --no-close-file           Do not close the file after each cycle
  -X, --no-chart                Do not display a bar chart of the run timings
  -j, --export-json <FILE>      Export the timing summary statistics and timings of individual runs as JSON to the given FILE. The output time unit is always seconds
      --export-log <FILE>       Export the log to the given FILE
  -d, --dry-run                 Do not actually perform benchmarks to the disk (file is still created and/or deleted)
  -v, --verbose...              More output per occurrence
  -q, --quiet...                Less output per occurrence
  -h, --help                    Print help
  -V, --version                 Print version

Methodology

Specify the path to a file to use for benchmarking. If the file exists, it will be deleted. You can specify paths on other drives by using the full path to the file (e.g. /Volumes/MyDrive/testfile.dat).

The benchmark tool will create a file of the specified size and then run the specified number of cycles. Each cycle will read or write the multiple blocks of a specified size to the file.

On macOS, the file is opened and F_NO_CACHE and F_GLOBAL_NOCACHE are both set on the file descriptor. This will bypass the file system cache and write directly to the disk. On Linux, the O_DIRECT flag is used to achieve the same result.

TODO

  • Separate file creation from opening for runs.
  • Display volume info in the preamble.
  • Better output - display timing info as well as rates.
  • Multithreaded benchmarking option.
  • Test on Windows.
  • Put on homebrew.
  • More documentation.
  • Run test coverage.
  • Borrow CPU time stuff from hyperfine.
  • Fuzz the StyleSheet code.
  • Random seeks instead of just sequential.
  • Use random bytes instead of zeros for writes
  • Use a better ByteSize replacement.
  • Add a --no-delete option to keep the file around after the benchmark.
  • Output data to JSON.
  • Output data to CSV. Won't do this. Use JSON and pipe to jq or csvkit.
  • Find out what's going on with all the dead_code false positives.
  • Sort out pub/mod stuff.

License

MIT License. See LICENSE file.

You might also like...
Rust File Management CLI is a command-line tool written in Rust that provides essential file management functionalities. Whether you're working with files or directories, this tool simplifies common file operations with ease.

Rust FileOps Rust File Management CLI is a command-line tool written in Rust that provides essential file management functionalities. Whether you're w

Blockoli is a high-performance tool for code indexing, embedding generation and semantic search tool for use with LLMs.
Blockoli is a high-performance tool for code indexing, embedding generation and semantic search tool for use with LLMs.

blockoli 🥦🔎 Blockoli is a high-performance tool for code indexing, embedding generation and semantic search tool for use with LLMs. blockoli is buil

A dead simple functional testing tool for command line applications

Pharaoh : build that test pyramid! What it is Pharaoh is a dead simple, no permission needed, functional test runner for command line applications, wr

A simple command line tool for creating font palettes for engines like libtcod

palscii A simple command line tool for creating font palettes for engines like libtcod. Usage This can also be viewed by running palscii --help. palsc

A simple cli tool to help with wordle in hard mode

Wordking A simple cli tool to help with wordle in hard mode. Usage Run wordking cargo run Wordking will ask for your guesses thus far. Provide your gu

A simple, modern fuzzy finder tool to run examples in a Cargo project.

cargo-rx cargo-rx is a simple, modern Runner for Examples in a Cargo project. This crate provides a single executable: rx. Basically anywhere you woul

☘️ A simple command line tool to manage your Minecraft Bedrock worlds
☘️ A simple command line tool to manage your Minecraft Bedrock worlds

☘️ Haze A simple command line tool to manage your Minecraft Bedrock worlds Haze allows you to keep your project's worlds out of the com.mojang directo

🎦 ezz is a simple CLI tool to schedule Zoom meetings

ezz ezz (cheesy abbreviation for easy Zoom) is a simple CLI tool to schedule Zoom meetings. Install With cargo installed: $ cargo install --path . Aut

✨ A simple and cute tool for exploring Wikipedia from the terminal ✨
✨ A simple and cute tool for exploring Wikipedia from the terminal ✨

Wikipe ✨ Wikipe ✨ is a tool to search Wikipedia from the command-line. Given a search query, it returns a list of matching Wikipedia articles, which c

Owner
Jonathan Wight
No.
Jonathan Wight
Blazing fast tool to benchmark Starknet sequencers 🦀

Gomu Gomu no Gatling Blazing fast tool to benchmark Starknet sequencers ?? . Installation From source git clone https://github.com/keep-starknet-stran

Keep StarkNet Strange 7 Jul 7, 2023
Zenith - sort of like top or htop but with zoom-able charts, CPU, GPU, network, and disk usage

Zenith - sort of like top or htop but with zoom-able charts, CPU, GPU, network, and disk usage

Benjamin Vaisvil 1.6k Jan 4, 2023
Terminal disk space navigator 🔭

Given a path on your hard-drive (which could also be the root path, eg. /). diskonaut scans it and indexes its metadata to memory so that you could explore its contents (even while still scanning!).

Aram Drevekenin 1.6k Dec 30, 2022
A library for loading and executing PE (Portable Executable) from memory without ever touching the disk

memexec A library for loading and executing PE (Portable Executable) from memory without ever touching the disk This is my own version for specific pr

FssAy 5 Aug 27, 2022
garbage-collecting on-disk object store, supporting higher level KV stores and databases.

marble Garbage-collecting disk-based object-store. See examples/kv.rs for a minimal key-value store built on top of this. Supports 4 methods: read: de

Komora 215 Dec 30, 2022
Executables on Disk? Bleh 🤮

Executables on Disk? Preposterous! Saving executables to disk is like telling EDRs that "Hey! Take a look at this thing I just fetched from the Intern

whokilleddb 87 Dec 18, 2022
A user-friendly, lightweight TUI for disk imaging

Caligula Burning Tool Caligula is a user-friendly, lightweight TUI for imaging disks. $ caligula burn -h Burn an image to a disk Usage: caligula burn

Astrid Yu 25 Mar 26, 2023
💾Saving Your Hard Disk, One Project at a Time

nodemore ?? Nodemore Recursively Searches Directories for Unused Projects Contents Why? Installation Usage Configuration Why? NodeJS has a horrible wa

Will 13 Apr 16, 2023
Run VM disk images using Podman / Docker / Kubernetes.

The crun-vm OCI Runtime crun-vm is an OCI Runtime that enables Podman, Docker, and Kubernetes to run QEMU-compatible Virtual Machine (VM) images. This

Containers 156 Nov 21, 2024
A command line tool written in Rust and designed to be a modern build tool + package manager for C/C++ projects.

CCake CCake is a command line tool written in Rust and designed to be a modern build tool + package manager for C/C++ projects. Goals To be easily und

Boston Vanseghi 4 Oct 24, 2022