forked from grpc/grpc-go
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
codec/proto: allow reuse of marshal byte buffers
Performance benchmarks can be found below. Obviously, a 10KB request and 10KB response is tailored to showcase this improvement as this is where codec buffer re-use shines, but I've run other benchmarks too (like 1-byte requests and responses) and there's no discernable impact on performance. To no one's surprise, the number of bytes allocated per operation goes down by almost exactly 10 KB across 60k+ queries, which suggests excellent buffer re-use. The number of allocations itself increases by 5-ish, but that's probably because of a few additional slice pointers that we need to store; these are 8-byte allocations and should have virtually no impact on the allocator and garbage collector. streaming-networkMode_none-bufConn_false-keepalive_false-benchTime_10s-trace_false-latency_0s-kbps_0-MTU_0-maxConcurrentCalls_1-reqSize_10240B-respSize_10240B-compressor_off-channelz_false-preloader_false Title Before After Percentage TotalOps 61821 65568 6.06% SendOps 0 0 NaN% RecvOps 0 0 NaN% Bytes/op 116033.83 105560.37 -9.03% Allocs/op 111.79 117.89 5.37% ReqT/op 506437632.00 537133056.00 6.06% RespT/op 506437632.00 537133056.00 6.06% 50th-Lat 143.303µs 136.558µs -4.71% 90th-Lat 197.926µs 188.623µs -4.70% 99th-Lat 521.575µs 507.591µs -2.68% Avg-Lat 161.294µs 152.038µs -5.74% Closes grpc#2816
- Loading branch information
Adhityaa Chandrasekar
committed
Nov 8, 2019
1 parent
4717e3b
commit 606cd73
Showing
9 changed files
with
111 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters