Best Command-Line Benchmarking Tools
Compare hyperfine, wrk, hey and dnspyre for timing shell commands, HTTP endpoints and DNS servers from the command line.
Updated
short verdict
Pick hyperfine to time any shell command with statistical analysis. For HTTP services, wrk generates the most load and supports LuaJIT scripting, while hey is simpler to run and supports HTTP/2. Use dnspyre when the target is a DNS server.
Command-line benchmarking covers different jobs. Timing a local command means repeated runs and statistics. Load testing a service means concurrent requests and latency distributions. hyperfine handles the first. wrk and hey handle HTTP load. dnspyre handles DNS load across several protocols. Choose by what you are measuring.
this page is for
- Developers comparing the runtime of two or more shell commands
- Engineers load testing HTTP APIs and web servers
- Network admins measuring DNS server performance
Runs any shell command repeatedly and reports statistics, which makes it the default for timing commands and comparing alternatives.
best for
- Comparing CLI tools or build commands side by side
- Benchmarks with cold or warm cache control
strengths
- Picks the run count automatically (minimum 10 runs, 3 seconds of measurement)
- Warmup runs, per-run preparation commands and parameterized ranges
- Detects outliers and corrects for shell startup time
- Exports CSV, JSON, Markdown and AsciiDoc; runs on Linux, macOS and Windows
weaknesses
- Times commands only; it does not generate concurrent network load
- Plotting relies on the Python scripts in the repository
Generates heavy HTTP load from a single multi-core machine using threads and epoll or kqueue.
best for
- Stress testing web servers and APIs at high concurrency
- Custom request logic through scripting
strengths
- Thread and connection control, e.g. wrk -t12 -c400 -d30s URL
- Reports latency distribution with standard deviation, requests per second and transfer rate
- Optional LuaJIT scripts to change methods, paths, headers and bodies
weaknesses
- HTTP only; it cannot time arbitrary commands or DNS
- Custom scenarios require writing Lua
- No installation instructions or HTTP/2 support are documented by the project
Sends a fixed number of HTTP requests at a set concurrency and prints a summary, suited to quick load checks.
best for
- Quick capacity checks on a web service
- Scripted runs that need CSV output
strengths
- Simple flags: -n requests, -c concurrency, -z duration
- Supports HTTP/1.1 and HTTP/2, custom headers, auth, request bodies and proxies
- Rate limiting and CSV export for later analysis
- Installs with brew install hey
weaknesses
- HTTP only, with no scripting language for custom scenarios
- Documented as a load tester, not as a multi-threaded high-throughput generator like wrk
Benchmarks DNS servers over UDP, TCP, DoT, DoH and DoQ, which none of the other tools here can do.
best for
- Validating DNS resolvers under load
- Comparing encrypted DNS protocols
strengths
- Protocol coverage: UDP, TCP, DNS over TLS, HTTPS and QUIC
- Load shaping with --number, --concurrency, --duration and --probability
- CLI histograms and plots (PNG, SVG, PDF) via --plot and --plotf
- Runs on macOS, Linux and Windows
weaknesses
- DNS only
- Plots and uneven load patterns need extra flags to set up
How to choose
The deciding factor is what you are timing.
- Timing local commands or scripts: hyperfine, for warmup, outlier detection and shell-overhead correction.
- Maximum HTTP load from one machine: wrk, with its multithreaded epoll/kqueue design.
- Quick HTTP test with HTTP/2 or rate limiting: hey, using -n, -c and -z.
- Scripted HTTP requests: wrk, through LuaJIT.
- DNS server performance, including DoT, DoH and DoQ: dnspyre.
When not to use these
- You need full browser or multi-step user journey testing; these tools send single requests or run commands.
- You need to profile where time goes inside a program; these tools only measure total elapsed time or response latency.
FAQ
- What is the best tool for benchmarking a shell command?
- hyperfine. It runs a command many times (at least 10 runs), reports statistics, flags outliers and can compare several commands side by side.
- Should I use wrk or hey for HTTP load testing?
- Use wrk when you need high load from one machine or Lua scripting. Use hey for a simple run with -n, -c and -z, HTTP/2 support and CSV export.
- Can I benchmark a DNS server from the command line?
- Yes, with dnspyre. It supports UDP, TCP, DoT, DoH and DoQ, and can plot results with --plot.
- Does hyperfine account for shell startup time?
- Yes. It measures shell startup time and subtracts it, or you can run commands without an intermediate shell for very fast operations.