{"id":14990798,"url":"https://github.com/orhun/zig-http-benchmarks","last_synced_at":"2025-04-12T03:24:13.892Z","repository":{"id":180383529,"uuid":"665053304","full_name":"orhun/zig-http-benchmarks","owner":"orhun","description":"Benchmarking Zig HTTP client against Rust, Go, Python, C++ and curl","archived":false,"fork":false,"pushed_at":"2023-10-22T00:06:03.000Z","size":642,"stargazers_count":53,"open_issues_count":3,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-25T22:51:32.989Z","etag":null,"topics":["benchmarking","curl","http","http-benchmarking","http-client","http-requests","http-server","python","rust","zig","zig-http","ziglang"],"latest_commit_sha":null,"homepage":"https://blog.orhun.dev/zig-bits-04/","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/orhun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":"orhun","patreon":"orhunp","custom":["https://www.buymeacoffee.com/orhun"]}},"created_at":"2023-07-11T10:30:13.000Z","updated_at":"2025-03-20T09:15:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"c774955f-5bfd-4d32-bac2-9ce92996f4e7","html_url":"https://github.com/orhun/zig-http-benchmarks","commit_stats":{"total_commits":39,"total_committers":5,"mean_commits":7.8,"dds":0.2564102564102564,"last_synced_commit":"65d56a5a2b611c07854467fd747162fa0310e142"},"previous_names":["orhun/zig-http-benchmarks"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orhun%2Fzig-http-benchmarks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orhun%2Fzig-http-benchmarks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orhun%2Fzig-http-benchmarks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orhun%2Fzig-http-benchmarks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orhun","download_url":"https://codeload.github.com/orhun/zig-http-benchmarks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248511018,"owners_count":21116333,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["benchmarking","curl","http","http-benchmarking","http-client","http-requests","http-server","python","rust","zig","zig-http","ziglang"],"created_at":"2024-09-24T14:20:52.494Z","updated_at":"2025-04-12T03:24:13.873Z","avatar_url":"https://github.com/orhun.png","language":"Zig","readme":"## `zig-http-benchmarks` ⚡\n\nRead the blog post: [**Zig Bits 0x4**](https://blog.orhun.dev/zig-bits-04/)\n\nThis repository contains a HTTP server/client implementation using Zig's standard library and benchmarks for comparing the client's performance with implementations in other programming languages such as Rust and Go.\n\n### Prerequisites\n\n- Zig (`\u003e=0.11`), Rust/Cargo, Go, Python\n- [Hyperfine](https://github.com/sharkdp/hyperfine) (for benchmarking)\n\n### Benchmarking\n\nTo run the benchmarks:\n\n```sh\nchmod +x bench.sh\n./bench.sh\n```\n\nThe result will be saved to `benchmarks.md` and `benchmarks.json`.\n\n```\n  rust-hyper ran\n    1.01 ± 0.02 times faster than rust-ureq\n    1.01 ± 0.02 times faster than rust-reqwest\n    1.24 ± 0.06 times faster than go-http-client\n    1.46 ± 0.05 times faster than rust-attohttpc\n    2.03 ± 0.05 times faster than zig-http-client\n    4.26 ± 0.12 times faster than curl\n    8.57 ± 0.12 times faster than python-http-client\n   19.93 ± 0.25 times faster than cpp-asio-httpclient\n```\n\n| Command               |    Mean [ms] | Min [ms] | Max [ms] |     Relative |\n| :-------------------- | -----------: | -------: | -------: | -----------: |\n| `curl`                | 457.9 ± 11.2 |    442.4 |    522.2 |  4.26 ± 0.12 |\n| `zig-http-client`     |  218.5 ± 4.8 |    210.3 |    240.3 |  2.03 ± 0.05 |\n| `rust-attohttpc`      |  157.2 ± 5.3 |    151.8 |    190.4 |  1.46 ± 0.05 |\n| `rust-hyper`          |  107.6 ± 1.3 |    104.4 |    114.8 |         1.00 |\n| `rust-reqwest`        |  108.7 ± 2.2 |    105.4 |    123.7 |  1.01 ± 0.02 |\n| `rust-ureq`           |  108.4 ± 2.3 |    105.7 |    123.1 |  1.01 ± 0.02 |\n| `go-http-client`      |  133.1 ± 6.2 |    127.6 |    159.2 |  1.24 ± 0.06 |\n| `python-http-client`  |  921.9 ± 5.9 |    911.4 |    947.1 |  8.57 ± 0.12 |\n| `cpp-asio-httpclient` | 2144.5 ± 4.5 |   2133.0 |   2168.2 | 19.93 ± 0.25 |\n\n### Plotting\n\nUse the [JSON data](https://github.com/sharkdp/hyperfine#json) along with the [scripts](https://github.com/sharkdp/hyperfine/tree/master/scripts) from the `hyperfine` examples to plot data using [`matplotlib`](https://matplotlib.org/). For example:\n\n```sh\ngit clone --depth 1 https://github.com/sharkdp/hyperfine\npython hyperfine/scripts/plot_whisker.py benchmarks.json\n```\n\n![plot_whisker](https://raw.githubusercontent.com/orhun/zig-http-benchmarks/output/benchmarks.png)\n\n### Environment\n\nThe results are coming from a GitHub runner (`ubuntu-latest`) and automated with [this workflow](https://github.com/orhun/zig-http-benchmarks/blob/master/.github/workflows/benchmark.yml).\n\nTo see the output for the latest run, check out the [`output`](https://github.com/orhun/zig-http-benchmarks/tree/output) branch in this repository.\n\n### License\n\n\u003csup\u003e\nLicensed under \u003ca href=\"LICENSE\"\u003eThe MIT License\u003c/a\u003e.\n\u003c/sup\u003e\n","funding_links":["https://github.com/sponsors/orhun","https://patreon.com/orhunp","https://www.buymeacoffee.com/orhun"],"categories":["Zig"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forhun%2Fzig-http-benchmarks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forhun%2Fzig-http-benchmarks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forhun%2Fzig-http-benchmarks/lists"}