{"id":15821061,"url":"https://github.com/anilsenay/go-http-vs-grpc","last_synced_at":"2026-04-26T12:32:53.243Z","repository":{"id":110291567,"uuid":"595865525","full_name":"anilsenay/go-http-vs-grpc","owner":"anilsenay","description":"Benchmark for HTTP and gRPC implementations in Golang","archived":false,"fork":false,"pushed_at":"2023-02-01T01:29:07.000Z","size":50,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-12T07:39:36.847Z","etag":null,"topics":["go","golang","grpc","http"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anilsenay.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":"2023-02-01T00:49:52.000Z","updated_at":"2023-02-01T11:47:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"d78364c8-a618-40fc-b059-87072dd9d12b","html_url":"https://github.com/anilsenay/go-http-vs-grpc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/anilsenay/go-http-vs-grpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anilsenay%2Fgo-http-vs-grpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anilsenay%2Fgo-http-vs-grpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anilsenay%2Fgo-http-vs-grpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anilsenay%2Fgo-http-vs-grpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anilsenay","download_url":"https://codeload.github.com/anilsenay/go-http-vs-grpc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anilsenay%2Fgo-http-vs-grpc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32297895,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T09:34:17.070Z","status":"ssl_error","status_checked_at":"2026-04-26T09:34:00.993Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["go","golang","grpc","http"],"created_at":"2024-10-05T07:20:21.113Z","updated_at":"2026-04-26T12:32:53.227Z","avatar_url":"https://github.com/anilsenay.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Notes:\n\n- I tested sending the same struct in both gRPC and HTTP and made simple benchmarks recording their response times.\n- There are some benchmark tests in `request_benchmark_test.go` file. You can run them with `go test -bench=. -benchtime=1000x -benchmem`. There are 2 tests as `BenchmarkServer` and `BenchmarkServer_NewClientEachRequest`. I tested that what if it creates new gRPC connection for each request or use a single one for all requests. According to the results of those benchmarks, creating new connection for each request is not efficient for gRPC while it loses advantages of itself.\n- Results may change by runs but gRPC was always better in my results.\n- This test may not accurately reflect reality, or they may have wrong implementations etc. If you think there are some issues you can open an issue or contribute directly.\n\n## Run benchmarks\n\n#### Generate plots:\n\n\u003e Draws plots for grpc and http benchmarks\n\nusage: `go run  cmd/benchmark/plots/plots.go \u003cnumber of requests\u003e \u003cnumber of concurrent request\u003e`\n\n```bash\ngo run cmd/benchmark/plots/plots.go 1000 20\n```\n\nLast run results:\n\n![echarts (2)](https://user-images.githubusercontent.com/1047345/215920137-c22e4091-53a8-4c79-b7cf-4198c713a918.png)\n\n\n#### gRPC benchmark:\n\n\u003e Prints time values in array\n\nusage: `go run cmd/benchmark/grpc/main.go \u003cnumber of requests\u003e \u003cnumber of concurrent request\u003e`\n\n```bash\ngo run cmd/benchmark/grpc/main.go 1000 20\n```\n\n#### HTTP benchmark:\n\n\u003e Prints time values in array\n\nusage: `go run cmd/benchmark/http/main.go \u003cnumber of requests\u003e \u003cnumber of concurrent request\u003e`\n\n```bash\ngo run cmd/benchmark/http/main.go 1000 20\n```\n\n## Run server/client\n\n#### gRPC server:\n\n```bash\ngo run cmd/grpc/server/server.go\n```\n\n#### gRPC client:\n\n```bash\ngo run cmd/grpc/client/client.go\n```\n\n#### HTTP server:\n\n```bash\ngo run cmd/http/server/server.go\n```\n\n#### HTTP client:\n\n```bash\ngo run cmd/http/client/client.go\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanilsenay%2Fgo-http-vs-grpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanilsenay%2Fgo-http-vs-grpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanilsenay%2Fgo-http-vs-grpc/lists"}