{"id":16748642,"url":"https://github.com/honeyryderchuck/http-clients-benchmark","last_synced_at":"2025-08-11T00:39:01.037Z","repository":{"id":137329971,"uuid":"379849808","full_name":"HoneyryderChuck/http-clients-benchmark","owner":"HoneyryderChuck","description":"(Mirror) Ruby HTTP Client Benchmarks","archived":false,"fork":false,"pushed_at":"2024-11-19T18:07:40.000Z","size":145,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-22T16:12:49.326Z","etag":null,"topics":["benchmark","http","ruby"],"latest_commit_sha":null,"homepage":"https://gitlab.com/os85/http-clients-benchmark","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HoneyryderChuck.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-24T08:03:49.000Z","updated_at":"2024-11-19T18:07:44.000Z","dependencies_parsed_at":"2024-11-19T18:39:57.063Z","dependency_job_id":"210043a9-f489-45bb-83f0-5f25f20ae1d4","html_url":"https://github.com/HoneyryderChuck/http-clients-benchmark","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoneyryderChuck%2Fhttp-clients-benchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoneyryderChuck%2Fhttp-clients-benchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoneyryderChuck%2Fhttp-clients-benchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoneyryderChuck%2Fhttp-clients-benchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HoneyryderChuck","download_url":"https://codeload.github.com/HoneyryderChuck/http-clients-benchmark/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243822142,"owners_count":20353495,"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":["benchmark","http","ruby"],"created_at":"2024-10-13T02:13:15.946Z","updated_at":"2025-08-11T00:39:01.024Z","avatar_url":"https://github.com/HoneyryderChuck.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ruby HTTP Client Benchmarks\n\nThis repository stores comparative benchmarks for known Ruby HTTP clients.\n\n## What's being benchmarked?\n\nThe current benchmarks are collected and compared:\n\n* Single: A single GET request to a peer (HTTP/1.1);\n* Persistent: Requests sent to the peer one after the other (HTTP/1.1 Keep-Alive);\n* Pipelined: Requests sent to the peer at once (HTTP/1.1 Pipelining);\n* Concurrent: Requests multiplexed to the peer (HTTP/2);\n\n(Clients may skip benchmarks if they do not supported the required functionality).\n\nThe benchmarks run inside a docker-compose cluster and perform requests against an [httpbin](https://httpbin.org/) instance (in go) behind an [nghttpx](https://nghttp2.org/documentation/nghttpx-howto.html) proxy. This makes the benchmarks less affected by network instability or peer delays/rate-limiting, so we get a better feel of how much overhead each option has.\n\n## Ruby Clients\n\nThe current http clients are being tested:\n\n* httpx\n* net-http\n* excon\n* http\n* curb (CRuby only)\n* typhoeus (CRuby only)\n* manticore (JRuby only)\n\nThe most recent release for each will be used.\n\n## Benchmarks\n\n### Single Request (HTTP/1.1)\n\nMeasures the overhead of a single HTTP/1.1 GET request.\n\n#### CRuby\n\n![single benchmark chart](https://gitlab.com/os85/http-clients-benchmark/-/jobs/artifacts/master/raw/snapshots/ruby-http-single-bench.png?job=benchmark)\n\n#### JRuby\n\n![single benchmark chart](https://gitlab.com/os85/http-clients-benchmark/-/jobs/artifacts/master/raw/snapshots/jruby-http-single-bench.png?job=benchmark+jruby)\n\n### Persistent (HTTP/1.1 Keep-Alive)\n\nMeasures the overhead of 200 HTTP/1.1 GET requests, sent sequentially over the same TCP connection.\n\n#### CRuby\n\n![persistent benchmark chart](https://gitlab.com/os85/http-clients-benchmark/-/jobs/artifacts/master/raw/snapshots/ruby-http-persistent-bench.png?job=benchmark)\n\n#### JRuby\n\n![persistent benchmark chart](https://gitlab.com/os85/http-clients-benchmark/-/jobs/artifacts/master/raw/snapshots/jruby-http-persistent-bench.png?job=benchmark+jruby)\n\n### Pipelined (HTTP/1.1)\n\nMeasures the overhead of 5000 HTTP/1.1 GET requests, sent simultaneously over the same TCP connection.\n\n#### CRuby\n\n![pipelined benchmark chart](https://gitlab.com/os85/http-clients-benchmark/-/jobs/artifacts/master/raw/snapshots/ruby-http-pipelined-bench.png?job=benchmark)\n\n#### JRuby\n\n![pipelined benchmark chart](https://gitlab.com/os85/http-clients-benchmark/-/jobs/artifacts/master/raw/snapshots/jruby-http-pipelined-bench.png?job=benchmark+jruby)\n\n### Concurrent (HTTP/2)\n\nMeasures the overhead of 5000 HTTP/2 GET requests, multiplexed over the same TCP connection.\n\n#### CRuby\n\n![concurrent benchmark chart](https://gitlab.com/os85/http-clients-benchmark/-/jobs/artifacts/master/raw/snapshots/ruby-http-concurrent-bench.png?job=benchmark)\n\n#### JRuby\n\n![concurrent benchmark chart](https://gitlab.com/os85/http-clients-benchmark/-/jobs/artifacts/master/raw/snapshots/jruby-http-concurrent-bench.png?job=benchmark+jruby)\n\n## How do you run the benchmark locally?\n\nUsing `docker`, you should just clone the project, and run:\n\n```bash\n$ docker-compose run benchmark\n```\n\nYou can alternatively run the benchmark script with different input:\n\n```bash\n# once you bundle install, and have everything in place:\n\u003e bundle exec ruby benchmarks/requests.rb --help\n```\n\n## Would you like to test another HTTP client?\n\n\n* Fork this repository;\n* Add a [new module for the http client](https://gitlab.com/os85/http-clients-benchmark/-/tree/master/clients);\n* Add a function for each supported module (i.e.: `.single`, `pipelined`, follow [this example](https://gitlab.com/os85/http-clients-benchmark/-/blob/master/clients/httpx.rb));\n* Make sure it works (run `ruby benchmarks/clients --help`);\n* Submit an MR with your changes;\n\n## FAQ\n\n### Why?\n\nAs the maintainer of `httpx`, I'm interested in how well it measures against other popular `ruby` alternatives, specifically in:\n\n#### Performance\n\nIn `ruby`, it's very common to hear that one should \"drop down to C\" in order to get more performance. `httpx` being pure `ruby`, I don't think, at least with modern `ruby`, that the implementation complexity is worth the cost; and `httpx` can perform as well or better as any other alternative. This benchmark keeps my assumptions honest.\n\n#### Feature completeness\n\nNot all clients support all features, so this chart can also be informative to anyone looking for feature coverage.\n\n#### API\n\nI also want to compare how \"friendly\" APIs are, when it comes to performing requests (disclaimer: `net-http` is as hard as it sounds).\n\n### Q.: How often are the benchmarks updated?\n\nOnce a month. My CI minutes are limited.\n\n### Q.: Which benchmark is the most important?\n\nIt depends of your workload. If you need to support concurrent requests, look at those. If you perform a request at a time not too often, probably you'd want to look at the single benchmark. However, you should take other parameters into consideration, such as API, maintainability, ease of integration, etc. .\n\n### Q.: What about memory usage, POST requests...?\n\nStill in the works. But feel free to make suggestions in the issues box.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoneyryderchuck%2Fhttp-clients-benchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhoneyryderchuck%2Fhttp-clients-benchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoneyryderchuck%2Fhttp-clients-benchmark/lists"}