{"id":24324738,"url":"https://github.com/uatuko/grpcxx","last_synced_at":"2025-09-27T09:31:23.971Z","repository":{"id":184007512,"uuid":"668902672","full_name":"uatuko/grpcxx","owner":"uatuko","description":"🚀 Blazing fast gRPC server (C++)","archived":false,"fork":false,"pushed_at":"2024-06-13T08:35:51.000Z","size":261,"stargazers_count":53,"open_issues_count":1,"forks_count":7,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-06-13T11:33:10.332Z","etag":null,"topics":["cpp20","grpc","grpc-server"],"latest_commit_sha":null,"homepage":"","language":"C++","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/uatuko.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","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-07-20T21:46:03.000Z","updated_at":"2024-06-13T08:35:54.000Z","dependencies_parsed_at":"2024-04-16T09:38:09.231Z","dependency_job_id":"763e0629-17dc-4f27-94a1-70e56f68cdd9","html_url":"https://github.com/uatuko/grpcxx","commit_stats":null,"previous_names":["uditha-atukorala/grpcxx","uatuko/grpcxx"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uatuko%2Fgrpcxx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uatuko%2Fgrpcxx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uatuko%2Fgrpcxx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uatuko%2Fgrpcxx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uatuko","download_url":"https://codeload.github.com/uatuko/grpcxx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234422930,"owners_count":18830315,"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":["cpp20","grpc","grpc-server"],"created_at":"2025-01-17T20:00:31.933Z","updated_at":"2025-09-27T09:31:23.602Z","avatar_url":"https://github.com/uatuko.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# grpcxx\n\n[![license](https://img.shields.io/badge/license-MIT-green)](https://raw.githubusercontent.com/uatuko/grpcxx/main/LICENSE)\n[![build](https://github.com/uatuko/grpcxx/actions/workflows/build.yaml/badge.svg?branch=main)](https://github.com/uatuko/grpcxx/actions/workflows/build.yaml)\n[![discussions](https://img.shields.io/github/discussions/uatuko/grpcxx)](https://github.com/uatuko/grpcxx/discussions)\n[![release](https://img.shields.io/github/v/release/uatuko/grpcxx)](https://github.com/uatuko/grpcxx/releases)\n\n🚀 Blazing fast gRPC C++ Server implemented using modern standards (C++20).\n\n## Features\n\n* Fast - 3x faster compared to the official implementation(s).\n* Simple - Overall smaller codebase and 95% less generated code compared to the official implementation.\n* Flexible - The application code is given greater implementation choice by using C++ concepts instead of being restricted to one choice.\n\n\n## Benchmarks\n\n\u003e [!NOTE]\n\u003e You can find more detailed benchmark results in https://github.com/uatuko/grpcxx/issues/25,\n\u003e https://github.com/uatuko/grpcxx/issues/21#issuecomment-1890901856 and https://github.com/uatuko/grpcxx/pull/26.\n\n|                                           | 1a  | 1b   | 2a   | 2b   | 3a   | 3b   |\n| ----------------------------------------- | --- | ---- | ---- | ---- | ---- | ---- |\n| gRPC v1.48.4 (callback)                   | 25k | 87k  | 76k  | **152k** | 96k  | 142k |\n| grpc-go v1.56.2                           | 27k | 103k | 94k  | 191k | 90k  | **308k** |\n| Rust (tonic v0.10.2)                      | 29k | 66k  | 95k  | 176k | 68k  | **212k** |\n| (`libuv`) grpcxx v0.2.0 (single-threaded) | 42k | 193k | 120k | 449k | 160k | **452k** |\n| (`libuv`) grpcxx v0.2.0 (2 workers)       | 33k | 166k | 120k | **431k** | 91k  | 425k |\n| (`libuv`) grpcxx v0.2.0 (10 workers)      | 34k | 164k | 118k | **450k** | 101k | 408k |\n| (`asio`) grpcxx (single-threaded)         | 15k | 22k  | 63k  | 110k | 91k  | **114k** |\n| (`asio`) grpcxx (3 workers)               | 27k | 112k | 84k  | 267k | 69k  | **290k** |\n| (`asio`) grpcxx (10 workers)              | 25k | 80k  | 75k  | 150k | 62k  | **162k** |\n\n## Documentation\n\nYou can find a bit more detailed documentation in [docs/](docs/README.md).\n\n\n## Getting started\n\n### Prerequisites\n\n* [CMake](https://cmake.org) (\u003e= 3.23)\n* [Protobuf](https://protobuf.dev) (\u003e= 3.15)\n\n### Installing\n\nThere aren't any installable packages at this stage but you can add this to your CMake project as a dependency using\n[FetchContent](https://cmake.org/cmake/help/latest/module/FetchContent.html).\n\ne.g.\n```cmake\n# grpcxx\nFetchContent_Declare(grpcxx\n  URL      https://github.com/uatuko/grpcxx/archive/refs/tags/v0.1.3.tar.gz\n  URL_HASH SHA256=441ca21bed3c0413623440c1608da44e60931631af1dc609c18e4a955f8cb3a5\n)\nFetchContent_MakeAvailable(grpcxx)\n```\n\n### Using grpcxx\n\n\u003e [!TIP]\n\u003e You can find a complete _helloworld_ example [here](https://github.com/uatuko/grpcxx/tree/main/examples/helloworld).\n\nIn order to use grpcxx (similar to other gRPC implementations) you'll need to;\n\n1. Generate code\n2. Implement RPC endpoints\n3. Run a server to process RPC requests\n\n#### Code generation\n\nYou can use the `protoc-gen-grpcxx` Protobuf compiler plugin to generate the Protobuf and gRPC server code.\n\ne.g.\n```\n❯ protoc --proto_path=. \\\n  --cpp_out=/path/to/output \\\n  --grpcxx_out=/path/to/output \\\n  --plugin=/path/to/protoc-gen-grpcxx \\\n  helloworld/v1/greeter.proto\n```\n\nThis will generate 3 files, which you'll need to compile and include in your build.\n```\n❯ tree /path/to/output\n/path/to/output\n└── helloworld\n  └── v1\n    ├── greeter.grpcxx.pb.h\n    ├── greeter.pb.cc\n    └── greeter.pb.h\n```\n\n#### Implementing RPC endpoints\n\nCode generation only creates a stub service to return `UNIMPLEMENTED` gRPC status responses for all the endpoints. You\nwill need to add your own implementation to return something more meaningful.\n\nOne way to do this is by specialising the generated `ServiceImpl` struct.\n\ne.g.\n```cpp\n#include \"helloworld/v1/greeter.grpcxx.pb.h\"\n\nusing namespace helloworld::v1::Greeter;\n\n// Implement rpc application logic using template specialisation for generated `ServiceImpl` struct\ntemplate \u003c\u003e\nrpcHello::result_type ServiceImpl::call\u003crpcHello\u003e(\n  grpcxx::context \u0026, const GreeterHelloRequest \u0026req) {\n  GreeterHelloResponse res;\n  res.set_message(\"Hello `\" + req.name() + \"` 👋\");\n  return {grpcxx::status::code_t::ok, res};\n}\n```\n\n\u003e [!TIP]\n\u003e The generated `ServiceImpl` struct is a very simple struct with 6 lines of code. You can easily create\n\u003e your own instead of having to use the generated code giving you more flexibility to structure your\n\u003e code in a way that works best for you. An example of this can be found [here](https://github.com/uatuko/grpcxx/blob/c6934c3223a76f50439bb1dda98aa25482829b95/examples/helloworld/main.cpp#L19).\n\n#### Running a server\n\ne.g.\n```cpp\nhelloworld::v1::Greeter::ServiceImpl greeter; // Instance of the RPC implementation\nhelloworld::v1::Greeter::Service     service(greeter); // Service (using the RPC implementation)\n\ngrpcxx::server server; // Server instance\nserver.add(service); // Add the service to the server instance\n\nstd::printf(\"Listening on [127.0.0.1:50051] ...\\n\");\nserver.run(\"127.0.0.1\", 50051); // Listen and serve\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuatuko%2Fgrpcxx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuatuko%2Fgrpcxx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuatuko%2Fgrpcxx/lists"}