commit | 0fc57d04142e87812884fb5f9b1b03f36b701034 | [log] [tgz] |
---|---|---|
author | Arjun Roy <arjunroy@google.com> | Wed Jun 26 15:15:07 2019 -0700 |
committer | Arjun Roy <arjunroy@google.com> | Wed Jun 26 15:15:07 2019 -0700 |
tree | a242146b389ca8a215778c7ca562063b814348ab | |
parent | 57d522eda350f5d78bf4cc2bf3551271d5b032a4 [diff] |
Slightly better codegen for hpack_encoder. hpack_encoder::ensure_space checks to see if we need to allocate to start a frame or not. The common case is that we don't need to, so we mark that code branch as the more likely one to occur. This causes the common case to jump around less. BM_HpackEncoderEncodeDeadline 152ns ± 0% 149ns ± 0% -1.99% (p=0.000 n=19+17) BM_HpackEncoderEncodeHeader<EmptyBatch>/0/16384 35.0ns ± 2% 34.6ns ± 0% -1.10% (p=0.000 n=20+17) BM_HpackEncoderEncodeHeader<EmptyBatch>/1/16384 34.9ns ± 1% 34.7ns ± 1% -0.81% (p=0.007 n=20+19) BM_HpackEncoderEncodeHeader<SingleStaticElem>/0/16384 50.6ns ± 0% 49.1ns ± 1% -3.06% (p=0.000 n=17+19) BM_HpackEncoderEncodeHeader<SingleInternedKeyElem>/0/16384 84.9ns ± 1% 82.4ns ± 1% -2.90% (p=0.000 n=20+19) BM_HpackEncoderEncodeHeader<SingleInternedElem>/0/16384 50.5ns ± 0% 49.2ns ± 1% -2.54% (p=0.000 n=15+19) BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<1, false>>/0/16384 50.8ns ± 2% 49.6ns ± 1% -2.46% (p=0.000 n=17+19) BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<3, false>>/0/16384 50.9ns ± 2% 49.5ns ± 1% -2.78% (p=0.000 n=20+19) BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<10, false>>/0/16384 50.4ns ± 1% 49.2ns ± 1% -2.32% (p=0.000 n=18+19) BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<31, false>>/0/16384 50.3ns ± 0% 49.2ns ± 1% -2.16% (p=0.000 n=18+19) BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<100, false>>/0/16384 50.4ns ± 1% 49.2ns ± 1% -2.35% (p=0.000 n=19+19) BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<1, true>>/0/16384 50.9ns ± 2% 49.4ns ± 1% -2.81% (p=0.000 n=20+19) BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<3, true>>/0/16384 50.9ns ± 2% 49.4ns ± 1% -2.91% (p=0.000 n=20+19) BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<10, true>>/0/16384 50.2ns ± 0% 49.2ns ± 0% -2.04% (p=0.000 n=17+19) BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<31, true>>/0/16384 50.4ns ± 1% 49.2ns ± 1% -2.38% (p=0.000 n=19+19) BM_HpackEncoderEncodeHeader<SingleInternedBinaryElem<100, true>>/0/16384 50.3ns ± 0% 49.2ns ± 0% -2.06% (p=0.000 n=19+19) BM_HpackEncoderEncodeHeader<SingleNonInternedElem>/0/16384 91.7ns ± 1% 85.6ns ± 1% -6.64% (p=0.000 n=19+19) BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<1, false>>/0/16384 116ns ± 1% 112ns ± 1% -3.95% (p=0.000 n=19+18) BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<3, false>>/0/16384 122ns ± 0% 117ns ± 1% -3.63% (p=0.000 n=18+17) BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<10, false>>/0/16384 145ns ± 1% 140ns ± 0% -2.89% (p=0.000 n=18+18) BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<31, false>>/0/16384 233ns ± 1% 231ns ± 1% -1.14% (p=0.000 n=20+19) BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<100, false>>/0/16384 472ns ± 1% 469ns ± 1% -0.64% (p=0.000 n=20+19) BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<1, true>>/0/16384 93.2ns ± 1% 87.3ns ± 1% -6.41% (p=0.000 n=20+17) BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<3, true>>/0/16384 94.2ns ± 1% 88.0ns ± 1% -6.59% (p=0.000 n=20+17) BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<10, true>>/0/16384 94.1ns ± 2% 87.5ns ± 1% -6.98% (p=0.000 n=20+17) BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<31, true>>/0/16384 107ns ± 2% 102ns ± 4% -4.30% (p=0.000 n=19+19) BM_HpackEncoderEncodeHeader<SingleNonInternedBinaryElem<100, true>>/0/16384 106ns ± 1% 100ns ± 1% -5.64% (p=0.000 n=20+17) BM_HpackEncoderEncodeHeader<SingleNonInternedElem>/0/1 356ns ± 1% 355ns ± 1% -0.47% (p=0.001 n=20+18) BM_HpackEncoderEncodeHeader<RepresentativeClientInitialMetadata>/0/16384 140ns ± 1% 128ns ± 1% -7.99% (p=0.000 n=20+19) BM_HpackEncoderEncodeHeader<MoreRepresentativeClientInitialMetadata>/0/16384 237ns ± 1% 218ns ± 1% -7.93% (p=0.000 n=19+19) BM_HpackEncoderEncodeHeader<RepresentativeServerInitialMetadata>/0/16384 73.7ns ± 1% 69.7ns ± 1% -5.47% (p=0.000 n=20+19) BM_HpackEncoderEncodeHeader<RepresentativeServerTrailingMetadata>/1/16384 50.7ns ± 0% 49.0ns ± 2% -3.19% (p=0.000 n=18+19)
gRPC is a modern, open source, high-performance remote procedure call (RPC) framework that can run anywhere. gRPC enables client and server applications to communicate transparently, and simplifies the building of connected systems.
To maximize usability, gRPC supports the standard method for adding dependencies to a user‘s chosen language (if there is one). In most languages, the gRPC runtime comes as a package available in a user’s language package manager.
For instructions on how to use the language-specific gRPC runtime for a project, please refer to these documents
src/cpp
directoryGrpc
grpc
go get google.golang.org/grpc
npm install grpc
gRPC-ProtoRPC
dependency to podspecpecl install grpc
pip install grpcio
gem install grpc
Per-language quickstart guides and tutorials can be found in the documentation section on the grpc.io website. Code examples are available in the examples directory.
Precompiled bleeding-edge package builds of gRPC master
branch's HEAD
are uploaded daily to packages.grpc.io.
Contributions are welcome!
Please read How to contribute which will guide you through the entire workflow of how to build the source code, how to run the tests, and how to contribute changes to the gRPC codebase. The “How to contribute” document also contains info on how the contribution process works and contains best practices for creating contributions.
Sometimes things go wrong. Please check out the Troubleshooting guide if you are experiencing issues with gRPC.
See the Performance dashboard for performance numbers of the latest released version.
See gRPC Concepts
This repository contains source code for gRPC libraries implemented in multiple languages written on top of a shared C core library src/core.
Libraries in different languages may be in various states of development. We are seeking contributions for all of these libraries:
Language | Source |
---|---|
Shared C [core library] | src/core |
C++ | src/cpp |
Ruby | src/ruby |
Python | src/python |
PHP | src/php |
C# | src/csharp |
Objective-C | src/objective-c |
Language | Source repo |
---|---|
Java | grpc-java |
Go | grpc-go |
NodeJS | grpc-node |
WebJS | grpc-web |
Dart | grpc-dart |