Skip to content

Benchmarking D HTTP clients against Rust, Go, Python and curl

License

Notifications You must be signed in to change notification settings

cyrusmsk/d_http_client_benchmark

Repository files navigation

D http client benchmark

This repository contains a HTTP client implementation for comparing the client's performance with implementations in other programming languages such as D, Rust and Go.

Prerequisites

  • D, Rust, Go, Python
  • Hyperfine (for benchmarking)

Results

plot_whisker

Results in a table

Benchmarking

To run the benchmarks:

chmod +x bench.sh
./bench.sh

The result will be saved to benchmarks.md and benchmarks.json.

Plotting

Use the JSON data along with the scripts from the hyperfine examples to plot data using matplotlib. For example:

git clone --depth 1 https://github.com/sharkdp/hyperfine
python hyperfine/scripts/plot_whisker.py benchmarks.json

TODO

Add: [x] httpx python

Environment

The results are coming from a GitHub runner (ubuntu-latest) and automated with this workflow.

To see the output for the latest run, check out the output branch in this repository.

Credits

zig-http-benchmarks - initial implementation mostly related to Zig language, which was adopted and adjusted for better time measurements (github repo)

http-clients-benchmark - benchmark ideas for HTTP clients testing in Ruby (gitlab repo)

rust clients test - some details about HTTP clients and CURL problems (Medium article, 2020)

License

Licensed under The MIT License.