gRPC vs REST Performance Comparison
Fast recall
Quick revision
Core answer
Whether you can quantify gRPC's performance story (protobuf size, HTTP/2 multiplexing, HPACK) with ballpark numbers, and know when the overhead of REST/JSON actually matters versus when it is irrelevant.
Claiming "gRPC is 10× faster" without context — on small payloads over LAN the difference is tiny; on large nested objects over the internet it can be significant. Or forgetting that gRPC-Web and browser clients erase much of the raw perf advantage.
Distinguish protobuf-on-the-wire savings from HTTP/2 multiplexing savings, explain where REST+HTTP/2+zstd closes most of the gap, and how persistent connection pooling makes both protocols competitive for service-to-service.
Interview-ready guide
Interview answer
gRPC is faster than REST for internal service calls for two compounding reasons: smaller payloads from Protocol Buffers and connection efficiency from HTTP/2. At scale, these savings compound in ways that REST's simplicity cannot offset.
Protocol Buffers — the payload advantage:
- Binary encoding with field numbers instead of repeated key names produces payloads 3–10× smaller than JSON; a list of 1,000 objects avoids repeating field names like "orderId", "customerId", "amount" for every element
- The compiled schema means deserialization is a direct memory copy instead of runtime character scanning, string escaping, and type inference; at 10K messages per second, the CPU savings alone are measurable — roughly 20–30% of a CPU core
HTTP/2 multiplexing — the connection advantage:
- All RPCs share one persistent TCP connection with full multiplexing — multiple in-flight requests without head-of-line blocking
- REST over HTTP/1.1 needs a new connection per request or connection pooling to approach similar efficiency; every new connection repeats the TCP and TLS handshake cost
Where the advantages compound:
- In service mesh scenarios with multiple hops, saving 5ms per hop across five services produces 25ms aggregate improvement on a single user request — the deeper the call chain, the larger the total payoff
- Teams have reported cutting internal latency by 60–70% switching high-frequency REST calls to gRPC on measured hot paths
When gRPC's advantages don't matter:
- Below roughly 1,000 requests per second, the performance difference is unmeasurable; REST's debuggability with curl, Postman, and browser tooling is a real advantage that gRPC cannot match
I recommend gRPC for east-west traffic on high-RPS internal paths where the performance savings are measurable, and REST at the edge and for low-traffic internal endpoints where debuggability matters more than microseconds.
gRPC vs REST Performance Comparison
Direct Answer
gRPC is typically 5–10x faster than REST/JSON for the same payload because it uses Protocol Buffers (binary, compact, no parsing overhead) over HTTP/2 (multiplexed, header compression, persistent connection). The performance advantage is most significant in high-throughput internal microservice communication, latency-sensitive paths, and mobile/IoT scenarios. For low-traffic public APIs the difference is often negligible.
Code Example
# Same logical payload: an Order with 20 fields, nested Address, 3 line items.
# Wire sizes (uncompressed, with default encoders):
# REST/JSON (Jackson, pretty=false) : ~620 bytes
# REST/JSON + gzip : ~330 bytes
# REST/JSON + brotli-4 : ~280 bytes
# gRPC / protobuf (default) : ~220 bytes
# gRPC / protobuf + gzip : ~190 bytes (usually not worth the CPU at this size)
# Per-call overhead (typical intra-DC round trip, m5.large, 1GbE):
#
# REST/JSON : 0.8 - 1.5 ms parse + 0.3 ms TLS reuse
# gRPC/protobuf : 0.1 - 0.3 ms parse + 0.1 ms HTTP/2 header frame
#
# For *small* request/response pairs the difference is often < 1 ms; it only
# dominates when you either (a) fan out many calls per request, or (b) send
# large nested payloads where protobuf's varints + field numbers save a lot.
# --- Quick benchmark harness (ghz for gRPC vs wrk for REST) ------------------
# gRPC: https://github.com/bojand/ghz
ghz --insecure \
--proto ./order.proto \
--call acme.order.v1.OrderService.GetOrder \
-d '{"order_id": "ord_42"}' \
-c 50 -n 50000 \
localhost:50051
# REST:
wrk -t4 -c50 -d30s \
-s ./post.lua \
--latency \
https://localhost:8443/v1/orders/ord_42
# Key takeaways from real measurements:
# * Binary protobuf wins on payload size and parse speed
# * HTTP/2 multiplexing wins when you open many concurrent RPCs on one TCP conn
# * HPACK header compression matters a lot for chatty APIs (tiny bodies, big headers)
# * REST + HTTP/2 + brotli closes most of the gap for public APIs
# * Browser clients of gRPC need gRPC-Web and an Envoy proxy, erasing part of the advantage
Common Mistakes & Pitfalls
Claiming "gRPC is 10× faster" without context — on small payloads over LAN the difference is tiny; on large nested objects over the internet it can be significant. Or forgetting that gRPC-Web and browser clients erase much of the raw perf advantage.
Check your understanding
Answer these without looking back at the article.
- How would you benchmark gRPC vs REST for your specific use case?
- Does HTTP/2 bring any performance benefits to REST that narrow the gap?
- What tools can you use to profile protobuf serialisation overhead in a Java application?
Related interview prep categories
1Want a guided curriculum order?
These modules are also sequenced in our flagship backend interview track — open it when you prefer an ordered path instead of browsing by topic.