{"id":338462,"date":"2022-09-17T09:00:14","date_gmt":"2022-09-17T09:00:14","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=338462"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=338462","title":{"rendered":"<span>Golang RPC \u0438 \u0432\u0441\u0435-\u0432\u0441\u0435-\u0432\u0441\u0435\u2026<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><em>Disclaimer: this is not another one gRPC hate article&#8230; Oh, whait&#8230;<\/em><\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c  \u0438\u0437\u0434\u0430\u043b\u0435\u043a\u0430 &#8212; \u0437\u043d\u0430\u0435\u0442\u0435, \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u044b\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0430 \u043f\u043e\u0447\u0435\u043c\u0443,  \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0434\u043b\u044f golang \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0430\u043a\u043e\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a,  \u0434\u043b\u044f \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439, \u043a\u0430\u043a-\u0442\u043e &#8212; <a href=\"https:\/\/habr.com\/ru\/company\/otus\/blog\/653009\/\" rel=\"noopener noreferrer nofollow\">\u0440\u043e\u0443\u0442\u0435\u0440\u044b http<\/a> (<a href=\"https:\/\/github.com\/valyala\/fasthttprouter\" rel=\"noopener noreferrer nofollow\">fasthttprouter<\/a> \u0437\u0430\u0431\u044b\u043b\u0438, \u043a\u0430\u043a \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u0430\u043b\u0438 \u0432 \u043a\u043e\u043c\u0435\u043d\u0442\u0430\u0445) \u0438\u043b\u0438 <a href=\"https:\/\/awesome-go.com\/caches\/\" rel=\"noopener noreferrer nofollow\">cache<\/a>?<\/p>\n<p>\u0421 \u0432\u044b\u0431\u043e\u0440\u043e\u043c RPC \u0432\u0440\u043e\u0434\u0435 \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e, gRPC &#8212; \u043d\u0430\u0448\u0435 \u0432\u0441\u0451 (\u0432\u044b, \u043a\u0441\u0442\u0430\u0442\u0438, \u0432 \u043a\u0443\u0440\u0441\u0435, \u0447\u0442\u043e g \u0437\u0434\u0435\u0441\u044c &#8212; \u044d\u0442\u043e \u043d\u0435 Google <a href=\"https:\/\/github.com\/grpc\/grpc\/blob\/master\/doc\/g_stands_for.md\" rel=\"noopener noreferrer nofollow\">\u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e<\/a>). \u041d\u043e \u043d\u0435 \u0442\u0443\u0442-\u0442\u043e \u0431\u044b\u043b\u043e&#8230;<\/p>\n<p>\u0412\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u0435\u0437 \u0443\u043c\u0430 \u043e\u0442 <s>\u041c\u044d\u0440\u0438<\/s> gRPC (\u043d\u0435\u0442).<\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432 golang \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438 net\/rpc \u0441\u043e \u0441\u0432\u043e\u0438\u043c \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c gob. \u0422\u0438\u043f\u0430 \u0435\u0441\u0442\u044c \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c &#8212; \u0432 golang \u0435\u0441\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 (\u0442\u0430\u043a \u0436\u0435 \u0438\u0441\u0442\u043e\u0440\u0438\u044f, \u0447\u0442\u043e \u0438 \u0441 \u0440\u043e\u0443\u0442\u0435\u0440\u043e\u043c http &#8212; \u043e\u043d \u0435\u0441\u0442\u044c, \u043d\u043e \u0432\u0441\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438\u0437-\u0437\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u0443\u0442\u0435\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432). \u0418 \u0442\u0443\u0442 \u0437\u0430\u0441\u0430\u0434\u0430 &#8212; \u044d\u0442\u043e\u0442 rpc \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0436\u0434\u0443 golang \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u041f\u043e\u0442\u043e\u043c \u0432\u044b\u043a\u0430\u0442\u0438\u043b\u0438 gRPC \u0438 \u0432\u0441\u0435 \u0437\u0430\u0432\u0435\u0440\u0442\u0435&#8230; \u0412\u043a\u0440\u0430\u0442\u0446\u0435 &#8212; gRPC \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 http\/2 \u0438 protobuf \u0434\u043b\u044f \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 (\u0437\u0430\u043f\u043e\u043c\u043d\u0438\u043c, rpc &#8212; \u044d\u0442\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u043e\u0431\u043c\u0435\u043d\u0430 \u043f\u043b\u044e\u0441 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440). \u041f\u0440\u0438\u0447\u0435\u043c gRPC \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432, \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435\u0442 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438, \u043d\u0430 \u0447\u0435\u043c \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0443\u044e \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c. So far, so good&#8230;<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0435 \u0432\u0441\u0435 \u0442\u0430\u043a \u0433\u043b\u0430\u0434\u043a\u043e&#8230; \u041f\u043e\u043d\u044f\u0442\u043d\u043e \u0441\u0442\u0440\u0435\u043c\u043b\u0435\u043d\u0438\u0435 Google \u043e\u0431\u044a\u044f\u0442\u044c \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043a\u0435\u0439\u0441\u044b, \u043d\u043e! \u041a \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 gRPC \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u043a\u0443\u0447\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432. \u0418\u043d\u0430\u0447\u0435 \u043a\u0430\u043a \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u043a\u0443\u0447\u0430 \u043a\u043e\u043d\u0442\u043e\u0440 \u043d\u0430\u0447\u0430\u043b\u0438 \u043f\u0438\u043b\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 RPC (\u0438\/\u0438\u043b\u0438 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432)? \u0422\u0430\u043a\u0436\u0435, \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e, \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a RPC \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0431\u043b\u0430\u043a\u0430 (\u0447\u0438\u0442\u0430\u0439 \u043c\u0435\u0436\u0434\u0443 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438) \u0438 RPC \u043c\u0435\u0436\u0434\u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c\u0438 \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 \u043e\u0431\u043b\u0430\u043a\u0430\/\u0434\u0430\u0442\u0430\u0446\u0435\u043d\u0442\u0440\u0430 \u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u0433\u043e (\u0437\u0430 ingress\/proxy\/load balancer &#8212; \u043a\u0430\u043a \u0445\u043e\u0442\u0438\u0442\u0435 \u043d\u0430\u0437\u044b\u0432\u0430\u0439\u0442\u0435) \u043a\u0430\u043a \u0431\u044b &#171;\u043d\u0435\u043c\u043d\u043e\u0436\u043a\u043e&#187; \u0440\u0430\u0437\u043d\u044b\u0435? \u0414\u0430 \u0438 \u0432\u044b\u0431\u043e\u0440 http\/2 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u0430 &#8212; \u043d\u0443 \u043a\u0442\u043e-\u0436\u0435 \u0437\u043d\u0430\u043b, \u0447\u0442\u043e \u0432\u043d\u0435\u0434\u0440\u0451\u0436 \u043f\u043e\u0439\u0434\u0435\u0442 \u043d\u0435 \u0442\u0430\u043a (\u0431\u044b\u0441\u0442\u0440\u043e), \u043a\u0430\u043a \u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c.<\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432, \u043e\u0431\u0449\u0435\u043f\u0440\u0438\u0437\u043d\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0432\u043e\u0440\u0438\u0442 &#8212; <a href=\"https:\/\/github.com\/gogo\/protobuf\" rel=\"noopener noreferrer nofollow\">gogo\/protobuf<\/a> (\u0444\u043e\u0440\u043a <a href=\"https:\/\/github.com\/golang\/protobuf\" rel=\"noopener noreferrer nofollow\">golang\/protobuf<\/a>), \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u043a\u043e\u0434 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430 \u0441\u0447\u0435\u0442 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u043e\u0442\u043a\u0430\u0437\u0430 \u043e \u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u0438\/\u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0434\u0440\u0443\u0433\u0438\u0445 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0439, \u043d\u043e \u043f\u043e\u0441\u0442\u043e\u0439\u0442\u0435 &#8212; \u043e\u043d \u0436\u0435 Deprecated (\u0438 \u0442\u0435\u043f\u0435\u0440\u044c <a href=\"https:\/\/github.com\/gogo\/protobuf\/issues\/691\" rel=\"noopener noreferrer nofollow\">\u0438\u0449\u0443\u0442 new ownership<\/a>)? \u0410 \u044d\u0442\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 Google \u043d\u0430 <a href=\"https:\/\/go.dev\/blog\/protobuf-apiv2\" rel=\"noopener noreferrer nofollow\">protobuf API v2<\/a>, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 gogo \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u043b\u0438 \u0437\u0430\u0431\u0438\u0442\u044c \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442 (\u044d\u0442\u043e \u043f\u0440\u0438\u0441\u043a\u043e\u0440\u0431\u043d\u043e), \u0447\u0435\u043c \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0433\u043e \u043a\u043e\u0434 \u043f\u043e\u0447\u0442\u0438 \u0446\u0435\u043b\u0438\u043a\u043e\u043c. \u0425\u043e\u0442\u044f \u0432\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u043a \u0441 gogo \u043d\u0430 API v2 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043b\u0438 &#8212; <a href=\"https:\/\/giedrius.blog\/2022\/02\/04\/things-learned-from-trying-to-migrate-to-protobuf-v2-api-from-gogoprotobuf-so-far\/\" rel=\"noopener noreferrer nofollow\">Things Learned From Trying to Migrate To Protobuf V2 API from gogoprotobuf (So Far)<\/a>.<\/p>\n<p>\u041d\u043e \u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u044d\u043d\u0442\u0443\u0437\u0438\u0430\u0441\u0442\u044b &#8212; \u0437\u0430\u0446\u0435\u043d\u0438\u0442\u0435 <a href=\"https:\/\/github.com\/planetscale\/vtprotobuf\" rel=\"noopener noreferrer nofollow\">vtprotobuf<\/a>. \u041f\u0430\u0440\u043d\u0438 \u0438\u0437 <a href=\"https:\/\/vitess.io\/\" rel=\"noopener noreferrer nofollow\">Vitess<\/a> \u0437\u0430\u043c\u043e\u0440\u043e\u0447\u0438\u043b\u0438\u0441\u044c, \u0438 \u0442\u0430\u043a\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0441\u0432\u043e\u0439 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u043e\u0434 protobuf API v2, \u043f\u0440\u0438\u0447\u0438\u043d\u044b \u0438 \u0446\u0438\u0444\u0440\u044b \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 <a href=\"https:\/\/vitess.io\/blog\/2021-06-03-a-new-protobuf-generator-for-go\/\" rel=\"noopener noreferrer nofollow\">A new Protocol Buffers generator for Go<\/a>.<\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438 &#8212; \u043d\u0435 protobuf \u0435\u0434\u0438\u043d\u044b\u043c, \u043a\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430 \u0436\u0435 Google \u043a\u043e\u0433\u0434\u0430-\u0442\u043e \u0437\u0430\u043c\u0443\u0442\u0438\u043b\u0430 <a href=\"https:\/\/github.com\/google\/flatbuffers\" rel=\"noopener noreferrer nofollow\">flatbuffers <\/a>\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440. \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0442\u043e, \u0447\u0442\u043e gRPC \u0432\u043e\u043e\u0431\u0449\u0435-\u0442\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u044b, \u0430 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e protobuf \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438. \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <a href=\"https:\/\/dgraph.io\/\" rel=\"noopener noreferrer nofollow\">Dgraph<\/a> (\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u0438 \u043a\u0430\u043a \u0440\u0430\u0437 \u0441 net\/rpc \u0441 flatbuffers \u0432\u043c\u0435\u0441\u0442\u043e gob), \u0430 \u043f\u043e\u0442\u043e\u043c \u043f\u0435\u0440\u0435\u0448\u043b\u0438 \u043d\u0430 gRPC, \u043d\u043e \u0442\u043e\u0436\u0435 \u0441 flatbuffers &#8212; <a href=\"https:\/\/dgraph.io\/blog\/post\/rpc-vs-grpc\/\" rel=\"noopener noreferrer nofollow\">Custom encoding: Go implementation in net\/rpc vs grpc and why we switched<\/a>.<\/p>\n<p>\u0412\u043e\u043e\u0431\u0449\u0435, \u043a\u0430\u043a \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u043e\u0441\u044c \u0440\u0430\u043d\u0435\u0435 &#8212; \u0435\u0441\u0442\u044c 100500 \u0440\u0430\u0437\u043d\u044b\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 (\u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u044d\u0442\u043e \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u043d\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e golang), \u0432\u043e\u0442 <a href=\"https:\/\/github.com\/alecthomas\/go_serialization_benchmarks\" rel=\"noopener noreferrer nofollow\">github \u0440\u0435\u043f\u0430<\/a>, \u0433\u0434\u0435 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432\u0441\u0435\u0445 (\u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435) \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432 \u0434\u043b\u044f golang, \u043f\u0440\u0430\u0432\u0434\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0442\u0430\u043c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u043d\u0430 \u0441\u0435\u0439\u0447\u0430\u0441 (gob \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435 JSON &#8212; \u044d\u0442\u043e \u043a\u0430\u043a \u0432\u043e\u043e\u0431\u0449\u0435?), \u0435\u0441\u043b\u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u043f\u043e \u0433\u043e\u0434\u0430\u043c:<\/p>\n<p><a href=\"https:\/\/github.com\/alecthomas\/go_serialization_benchmarks\/blob\/d7f2120213c6af6153a9b71f27eb27e428ec1423\/README.md\" rel=\"noopener noreferrer nofollow\">2022\/09\/05 &#8212; Go 1.16.5 linux\/amd64 i7-3630QM<\/a><\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"center\"><strong>benchmark<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>iter<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"center\"><strong>time\/iter<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"center\"><strong>bytes\/op<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>allocs\/op<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Json_Marshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">189709<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">6090<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">151<\/p>\n<\/td>\n<td>\n<p align=\"right\">208<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Json_Unmarshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">92833<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">12751<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">151<\/p>\n<\/td>\n<td>\n<p align=\"right\">383<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Gob_Marshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">71692<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">16463<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">163<\/p>\n<\/td>\n<td>\n<p align=\"right\">1616<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Gob_Unmarshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">14772<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">84385<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">163<\/p>\n<\/td>\n<td>\n<p align=\"right\">7688<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Goprotobuf_Marshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">1405010<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">854<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">53<\/p>\n<\/td>\n<td>\n<p align=\"right\">64<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Goprotobuf_Unmarshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">973688<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">1255<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">53<\/p>\n<\/td>\n<td>\n<p align=\"right\">168<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Gogoprotobuf_Marshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">3359550<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">354<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">53<\/p>\n<\/td>\n<td>\n<p align=\"right\">64<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Gogoprotobuf_Unmarshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">1908633<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">619<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">53<\/p>\n<\/td>\n<td>\n<p align=\"right\">96<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Musgo_Marshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">4294477<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">280<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">46<\/p>\n<\/td>\n<td>\n<p align=\"right\">48<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Musgo_Unmarshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">2498404<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">480<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">46<\/p>\n<\/td>\n<td>\n<p align=\"right\">96<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><a href=\"https:\/\/github.com\/alecthomas\/go_serialization_benchmarks\/blob\/6f010e2a1cfe9cfa584fa261929e49f7fd7fd26b\/README.md\" rel=\"noopener noreferrer nofollow\">2021\/06\/21 &#8212; Go 1.16.5 linux\/amd64 i7-3630QM<\/a><\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"center\"><strong>benchmark<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>iter<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"center\"><strong>time\/iter<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"center\"><strong>bytes\/op<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>allocs\/op<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Json_Marshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">501478<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">2538<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">151<\/p>\n<\/td>\n<td>\n<p align=\"right\">208<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Json_Unmarshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">226456<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">5023<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">151<\/p>\n<\/td>\n<td>\n<p align=\"right\">383<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Gob_Marshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">1320562<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">882<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">63<\/p>\n<\/td>\n<td>\n<p align=\"right\">40<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Gob_Unmarshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">1000000<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">1041<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">63<\/p>\n<\/td>\n<td>\n<p align=\"right\">112<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Goprotobuf_Marshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">3247056<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">378<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">53<\/p>\n<\/td>\n<td>\n<p align=\"right\">64<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Goprotobuf_Unmarshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">1839267<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">651<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">53<\/p>\n<\/td>\n<td>\n<p align=\"right\">168<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Gogoprotobuf_Marshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">5886194<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">204<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">53<\/p>\n<\/td>\n<td>\n<p align=\"right\">64<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Gogoprotobuf_Unmarshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">3464098<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">345<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">53<\/p>\n<\/td>\n<td>\n<p align=\"right\">96<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Musgo_Marshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">12882543<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">86<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">0<\/p>\n<\/td>\n<td>\n<p align=\"right\">0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Musgo_Unmarshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">3381966<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">343<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">96<\/p>\n<\/td>\n<td>\n<p align=\"right\">96<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0412 \u0434\u0440\u0443\u0433\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u043d\u0430\u0448\u043b\u0438\u0441\u044c \u0431\u043e\u043b\u0435\u0435 &#171;\u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u044b\u0435&#187; \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b:<\/p>\n<p><a href=\"https:\/\/morioh.com\/p\/0ba142bf20f3\" rel=\"noopener noreferrer nofollow\">2022\/03\/19 Go 1.17.8 Darwin\/arm64 Apple M1 Max<\/a><\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"center\"><strong>benchmark<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>iter<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"center\"><strong>time\/iter<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"center\"><strong>bytes\/op<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>allocs\/op<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Json_Marshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">1440837<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">822<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">148<\/p>\n<\/td>\n<td>\n<p align=\"right\">208<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Json_Unmarshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">653754<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">1817<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">148<\/p>\n<\/td>\n<td>\n<p align=\"right\">399<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Gob_Marshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\"> 2750721<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">440<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">63<\/p>\n<\/td>\n<td>\n<p align=\"right\">40<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Gob_Unmarshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">2918254<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">410<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">63<\/p>\n<\/td>\n<td>\n<p align=\"right\">112<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Goprotobuf_Marshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">6831308<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">176<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">53<\/p>\n<\/td>\n<td>\n<p align=\"right\">64<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Goprotobuf_Unmarshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">5746256<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">210<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">53<\/p>\n<\/td>\n<td>\n<p align=\"right\">168<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Gogoprotobuf_Marshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">16528346<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">72<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">53<\/p>\n<\/td>\n<td>\n<p align=\"right\">64<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Gogoprotobuf_Unmarshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">12764978<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">94<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">53<\/p>\n<\/td>\n<td>\n<p align=\"right\">96<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Musgo_Marshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">22535546<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">53<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">48<\/p>\n<\/td>\n<td>\n<p align=\"right\">0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Musgo_Unmarshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">12952696<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">90<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">48<\/p>\n<\/td>\n<td>\n<p align=\"right\">96<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0412 \u043e\u0431\u0449\u0435\u043c, gogo \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0432 \u0434\u0432\u0430 \u0440\u0430\u0437\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0442 Google. \u041a\u0441\u0442\u0430\u0442\u0438, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043d\u0435\u043a\u0438\u0439 <a href=\"https:\/\/github.com\/ymz-ncnk\/musgo\" rel=\"noopener noreferrer nofollow\">musgo<\/a> &#8212; \u043e\u0447\u0435\u043d\u044c \u0434\u0430\u0436\u0435 \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0441\u0435\u0431\u044f \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 (\u0438\u0431\u043e codegen). \u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441\u0442\u043e\u0438\u043b\u043e \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 <a href=\"https:\/\/msgpack.org\/\" rel=\"noopener noreferrer nofollow\">msgpack<\/a> &#8212; \u043f\u0440\u043e\u0435\u043a\u0442 \u043e\u0442 opensource \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0441\u0435 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0432\u0437\u043b\u0435\u0442\u0438\u0442 \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0443\u0435\u0442 (\u043d\u043e \u043f\u043e\u0434\u0432\u0438\u0436\u043a\u0438 \u0432\u0440\u043e\u0434\u0435 \u0435\u0441\u0442\u044c). \u0414\u043b\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0447\u0442\u0435\u043d\u0438\u044f &#8212; <a href=\"https:\/\/habr.com\/ru\/company\/scalablesolutions\/blog\/672840\/\" rel=\"noopener noreferrer nofollow\">\u0417\u043e\u043e\u043f\u0430\u0440\u043a \u0432 Golang MSA. Protobuf, MessagePack, Gob \u2013 \u0447\u0442\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c?<\/a><\/p>\n<p>\u0418\u0434\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435. \u0412\u0441\u0435 \u0447\u0430\u0449\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u044b \u0437\u0430\u0434\u0430\u044e\u0442\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c, \u0430 \u0447\u043e\u0439-\u0442\u0430 golang gRPC \u0442\u0430\u043a\u043e\u0439 \u043c\u043e\u043d\u0441\u0442\u0440\u0443\u043e\u0437\u043d\u044b\u0439 \u0432 \u043f\u043b\u0430\u043d\u0435 \u043e\u0432\u0435\u0440\u0445\u0435\u0434\u0430 \u043d\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438? \u0418 \u043f\u043e\u0447\u0435\u043c\u0443 \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u0443 \u043d\u0435\u0433\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f http\/2 \u0441\u0442\u0435\u043a\u0430, \u0430 \u043d\u0435 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u0430 &#171;golang.org\/x\/net\/http2&#187; (\u043d\u0443 \u0434\u0430, \u0442\u0438\u043f\u044b \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u0438\u0437 \u043d\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f, \u043d\u043e \u043d\u0435 \u0431\u043e\u043b\u0435\u0435). \u0418 \u0432\u043e\u043e\u0431\u0449\u0435 &#8212; \u043d\u0435 \u0442\u0430\u043a \u0432\u0441\u0435 \u0433\u043b\u0430\u0434\u043a\u043e \u0441 \u043f\u0440\u043e\u0431\u0440\u043e\u0441\u043e\u043c http\/2 \u0447\u0435\u0440\u0435\u0437 load balancers.<\/p>\n<p>\u0414\u0430\u0431\u044b \u0440\u0435\u0448\u0438\u0442\u044c \u0434\u0432\u0435 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b &#8212; \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043e\u0434\u0430 (\u0447\u0438\u0442\u0430\u0439, \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0439 \u0432\u043e\u0439\u043d\u044b \u0441 \u0431\u0430\u0433\u0430\u043c\u0438 \u0438 breaking changes, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 Google, \u0432\u0438\u0434\u0438\u043c\u043e &#8212; &#171;\u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0435&#187; \u044f\u0432\u043b\u0435\u043d\u0438\u0435) \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 http 1.1, \u0432 <a href=\"https:\/\/www.twitch.tv\/\" rel=\"noopener noreferrer nofollow\">Twitch<\/a> \u0437\u0430\u043f\u0438\u043b\u0438\u043b\u0438 \u0441\u0432\u043e\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a <a href=\"https:\/\/github.com\/twitchtv\/twirp\" rel=\"noopener noreferrer nofollow\">Twirp<\/a> (\u043a\u0441\u0442\u0430\u0442\u0438, http\/2 \u0442\u043e\u0436\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 golang) &#8212; <a href=\"https:\/\/blog.twitch.tv\/en\/2018\/01\/16\/twirp-a-sweet-new-rpc-framework-for-go-5f2febbf35f\/\" rel=\"noopener noreferrer nofollow\">Twirp: a sweet new RPC framework for Go<\/a>, \u043e \u043d\u0435\u043c \u0438 \u043d\u0430 Habr \u0442\u043e\u0436\u0435 \u043f\u0438\u0441\u0430\u043b\u043e\u0441\u044c &#8212; <a href=\"https:\/\/habr.com\/ru\/post\/354706\/\" rel=\"noopener noreferrer nofollow\">Twirp \u043f\u0440\u043e\u0442\u0438\u0432 gRPC. \u0421\u0442\u043e\u0438\u0442 \u043b\u0438?<\/a><\/p>\n<p>\u041f\u043e \u0442\u0435\u043c \u0436\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c \u0432 <a href=\"https:\/\/www.storj.io\/\" rel=\"noopener noreferrer nofollow\">Storj<\/a> \u0442\u043e\u0436\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0441\u0432\u043e\u044e \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0443 gRPC &#8212; <a href=\"https:\/\/github.com\/storj\/drpc\" rel=\"noopener noreferrer nofollow\">DRPC<\/a>, \u0441\u043c. \u0441\u0442\u0430\u0442\u044c\u044e <a href=\"https:\/\/www.storj.io\/blog\/introducing-drpc-our-replacement-for-grpc\" rel=\"noopener noreferrer nofollow\">Introducing DRPC: Our Replacement for gRPC<\/a>, \u043f\u0440\u0438\u0447\u0435\u043c \u043e\u043d\u0438 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u0438 Twirp, \u043a\u0430\u043a \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043d\u043e \u0432 \u043d\u0435\u043c \u043d\u0435 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043d\u0443\u0436\u043d\u043e\u0439 \u0444\u0438\u0447\u0438 &#8212; \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u0430 (\u043a\u0430\u043a \u0432 gRPC), \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432 DRPC \u0442\u043e\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438.<\/p>\n<p>\u041f\u043e\u0441\u0442\u043e\u0439\u0442\u0435-\u043a\u0430, \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u0432\u0441\u0435 \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440\u044b \u0432\u0435\u043b\u0438\u0441\u044c \u043e RPC \u043c\u0435\u0436\u0434\u0443, \u0443\u0441\u043b\u043e\u0432\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u043e\u0431\u043b\u0430\u043a\u043e\u043c \u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c\u0438 \u043d\u0430 PC\/Mobile. \u0410 \u0437\u0430\u0447\u0435\u043c \u0442\u0430\u043a\u0438\u0435 \u043d\u0430\u0432\u043e\u0440\u043e\u0442\u044b \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432? \u041f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 plain TCP (\u0438\u043b\u0438 \u0434\u0430\u0436\u0435 UDP, \u0432 \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u0438\u0433\u0440\u0443\u0448\u043a\u0430\u0445 \u0442\u0430\u043a \u0434\u0435\u043b\u0430\u044e\u0442 \u0438\u043d\u043e\u0433\u0434\u0430)? \u0410\u0445, \u0434\u0430 &#8212; net\/rpc \u0436\u0435 \u0435\u0441\u0442\u044c (\u0447\u0442\u043e \u0432\u0430\u043c \u0435\u0449\u0435 \u043d\u0443\u0436\u043d\u043e-\u0442\u043e, \u043a\u0430\u043a \u0431\u044b \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 Google).<\/p>\n<p>\u041d\u0443\u0436\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u0444\u0438\u0447! \u0422\u0430\u043a \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <a href=\"https:\/\/github.com\/valyala\/gorpc\" rel=\"noopener noreferrer nofollow\">valyala\/gorpc<\/a>, \u0430 \u0437\u0430\u0442\u0435\u043c \u0438 <a href=\"https:\/\/github.com\/valyala\/fastrpc\" rel=\"noopener noreferrer nofollow\">valyala\/fastrpc<\/a> \u043e\u0442 \u0410\u043b\u0435\u043a\u0441\u0430\u043d\u0434\u0440\u0430 \u0412\u0430\u043b\u044f\u043b\u043a\u0438\u043d\u0430, \u0430\u0432\u0442\u043e\u0440\u0430 <a href=\"https:\/\/github.com\/valyala\/fasthttp\" rel=\"noopener noreferrer nofollow\">fasthttp<\/a> (\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0440\u043e \u043d\u0435\u0451 \u0442\u0443\u0442 \u043d\u0430 Habr &#8212; <a href=\"https:\/\/habr.com\/ru\/post\/509240\/\" rel=\"noopener noreferrer nofollow\">\u0413\u0440\u0435\u0445\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438<\/a>).<\/p>\n<p>\u041f\u0440\u0438 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0438 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 RPC \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u043c\u043d\u043e\u0433\u043e (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"https:\/\/github.com\/smallnest\/rpcx\" rel=\"noopener noreferrer nofollow\">rpcx<\/a>, <a href=\"https:\/\/github.com\/cloudwego\/kitex\" rel=\"noopener noreferrer nofollow\">kitex<\/a>, <a href=\"https:\/\/github.com\/lesismal\/arpc\" rel=\"noopener noreferrer nofollow\">arpc<\/a>, \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0438\u0445 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441 gRPC \u0438 net\/rpc &#8212; <a href=\"https:\/\/www.sobyte.net\/post\/2022-08\/go-rpc-frameworks\/\" rel=\"noopener noreferrer nofollow\">2022 Go Ecosystem rpc Framework Benchmark<\/a>), \u043d\u043e \u043d\u0430 \u0441\u043b\u0443\u0445\u0443 \u0443 \u0432\u0441\u0435\u0445 gRPC \u043a\u0430\u043a \u043d\u0435\u043a\u0430\u044f &#171;\u0441\u0435\u0440\u0435\u0431\u0440\u044f\u043d\u0430\u044f \u043f\u0443\u043b\u044f&#187;.<\/p>\n<p>\u0418 \u043f\u0440\u043e UDP based RPC &#8212; \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 Hprose (High Performance Remote Object Service Engine) \u043e\u0442 \u043a\u0438\u0442\u0430\u0439\u0441\u043a\u0438\u0445 \u0442\u043e\u0432\u0430\u0440\u0438\u0449\u0435\u0439, \u043e\u043d \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432, \u0438 \u0434\u043b\u044f <a href=\"https:\/\/github.com\/hprose\/hprose-golang\" rel=\"noopener noreferrer nofollow\">golang \u0442\u043e\u0436\u0435 \u0435\u0441\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/a>, \u0442\u0430\u043a \u0432\u043e\u0442 &#8212; \u0442\u0430\u043c \u0435\u0441\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 UDP. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432\u044b\u0448\u0435\u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0439 rpcx \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 TCP, HTTP, <a href=\"https:\/\/en.wikipedia.org\/wiki\/QUIC\" rel=\"noopener noreferrer nofollow\">QUIC<\/a> (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c UDP) and <a href=\"https:\/\/github.com\/skywind3000\/kcp\/blob\/master\/README.en.md\" rel=\"noopener noreferrer nofollow\">KCP<\/a> (\u0442\u0430\u043a \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0438\u0442\u0430\u0439\u0441\u043a\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 QUIC, \u0442\u043e\u0436\u0435 \u043d\u0430 UDP).<\/p>\n<p>\u041d\u0443 \u0438 \u043d\u0430\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a, \u043a \u0432\u043e\u043f\u0440\u043e\u0441\u0443 \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 gRPC \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c&#8230; \u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0435\u0433\u043e \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c. \u0422\u0443\u0442 \u0432\u043e\u0442 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0441\u043b\u043e\u0443\u043f\u043e\u043a\u0438 \u043f\u0438\u0448\u0443\u0442 \u0432 2022 \u0433\u043e\u0434\u0443-\u0442\u043e <a href=\"https:\/\/ably.com\/blog\/grpc-stream-performance\" rel=\"noopener noreferrer nofollow\">The Mysterious Gotcha of gRPC Stream Performance<\/a>, \u0443 \u043d\u0430\u0441 \u0442\u0430\u043a\u043e\u0439 \u0442\u0440\u044e\u043a \u0432 PROD \u0443\u0436\u0435 \u0433\u043e\u0434\u0430 4 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f: \u043a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0432 gRPC \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u0438 \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u043e\u0432\u044b\u0435, \u0442\u0430\u043a \u0432\u043e\u0442 &#8212; \u0435\u0441\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0443\u043b \u0441\u0442\u0440\u0438\u043c\u043e\u0432 \u0432\u043c\u0435\u0441\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430, \u0442\u043e \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432 \u0434\u0432\u0430 \u0440\u0430\u0437\u0430 (\u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0438\u043b\u0438 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043d\u044b\u043c\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438 &#8212; \u043d\u0435\u0432\u0430\u0436\u043d\u043e), \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<p><strong>api.proto<\/strong><\/p>\n<pre><code class=\"go\">syntax = \"proto3\";  package pb  message Request {} message Response {}  service Service {   rpc Unary (Request) returns (Response);   rpc Stream (stream Request) returns (stream Response); }<\/code><\/pre>\n<p><strong>server.go<\/strong><\/p>\n<pre><code class=\"go\">func (s *grpcServer) Unary(ctx context.Context, req *pb.Request) (*pb.Response, error) { return &amp;pb.ResponseDomain{}, nil }  func (s *grpcServer) Stream(stream pb.Service_StreamServer) error { ctx := stream.Context() for { select { case &lt;-ctx.Done(): return ctx.Err() default: }  req, err := stream.Recv() if err == io.EOF { break }  if err != nil { return err }  resp, _ := s.Unary(ctx, req) if err := stream.Send(resp); err != nil { return err } } return nil }<\/code><\/pre>\n<p><strong>client.go<\/strong><\/p>\n<pre><code class=\"go\">func (c *grpcClient) Call(ctx context.Context, req *pb.Request) (*pb.Response, error) { if !c.streams { return c.client.Unary(ctx, req) }  stream := c.getStreamFromPool() if stream == nil { return nil, fmt.Errorf(\"no stream\") }  if err := stream.Send(req); err != nil { stream, err = c.client.Stream(ctx) if err != nil { return nil, err } }  defer c.putStreamToPool(stream) return stream.Recv() }<\/code><\/pre>\n<p>\u041d\u043e \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u044d\u0442\u043e c\u043b\u043e\u043c\u0430\u0435\u0442\u0441\u044f (\u0445\u043e\u0442\u044f \u044d\u0442\u043e \u0445\u0430\u043a, \u043a\u0430\u043a \u043d\u0438 \u043a\u0440\u0443\u0442\u0438), \u0438\u043d\u0430\u0447\u0435 \u0442\u0430\u043a\u0438\u0445 <a href=\"https:\/\/twitter.com\/dave_universetf\/status\/1399585509765042181\" rel=\"noopener noreferrer nofollow\">\u0442\u0432\u0438\u0442\u043e\u0432<\/a> \u0431\u044b \u043d\u0435 \u0431\u044b\u043b\u043e, \u044f \u0434\u0443\u043c\u0430\u044e.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/66b\/ca5\/3f2\/66bca53f27f77d89b90c2d775822e261.png\" width=\"898\" height=\"380\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/66b\/ca5\/3f2\/66bca53f27f77d89b90c2d775822e261.png\"\/><figcaption><\/figcaption><\/figure>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/688756\/\"> https:\/\/habr.com\/ru\/post\/688756\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><em>Disclaimer: this is not another one gRPC hate article&#8230; Oh, whait&#8230;<\/em><\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c  \u0438\u0437\u0434\u0430\u043b\u0435\u043a\u0430 &#8212; \u0437\u043d\u0430\u0435\u0442\u0435, \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u044b\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0430 \u043f\u043e\u0447\u0435\u043c\u0443,  \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0434\u043b\u044f golang \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0430\u043a\u043e\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a,  \u0434\u043b\u044f \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439, \u043a\u0430\u043a-\u0442\u043e &#8212; <a href=\"https:\/\/habr.com\/ru\/company\/otus\/blog\/653009\/\" rel=\"noopener noreferrer nofollow\">\u0440\u043e\u0443\u0442\u0435\u0440\u044b http<\/a> (<a href=\"https:\/\/github.com\/valyala\/fasthttprouter\" rel=\"noopener noreferrer nofollow\">fasthttprouter<\/a> \u0437\u0430\u0431\u044b\u043b\u0438, \u043a\u0430\u043a \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u0430\u043b\u0438 \u0432 \u043a\u043e\u043c\u0435\u043d\u0442\u0430\u0445) \u0438\u043b\u0438 <a href=\"https:\/\/awesome-go.com\/caches\/\" rel=\"noopener noreferrer nofollow\">cache<\/a>?<\/p>\n<p>\u0421 \u0432\u044b\u0431\u043e\u0440\u043e\u043c RPC \u0432\u0440\u043e\u0434\u0435 \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e, gRPC &#8212; \u043d\u0430\u0448\u0435 \u0432\u0441\u0451 (\u0432\u044b, \u043a\u0441\u0442\u0430\u0442\u0438, \u0432 \u043a\u0443\u0440\u0441\u0435, \u0447\u0442\u043e g \u0437\u0434\u0435\u0441\u044c &#8212; \u044d\u0442\u043e \u043d\u0435 Google <a href=\"https:\/\/github.com\/grpc\/grpc\/blob\/master\/doc\/g_stands_for.md\" rel=\"noopener noreferrer nofollow\">\u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e<\/a>). \u041d\u043e \u043d\u0435 \u0442\u0443\u0442-\u0442\u043e \u0431\u044b\u043b\u043e&#8230;<\/p>\n<p>\u0412\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u0435\u0437 \u0443\u043c\u0430 \u043e\u0442 <s>\u041c\u044d\u0440\u0438<\/s> gRPC (\u043d\u0435\u0442).<\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432 golang \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438 net\/rpc \u0441\u043e \u0441\u0432\u043e\u0438\u043c \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c gob. \u0422\u0438\u043f\u0430 \u0435\u0441\u0442\u044c \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c &#8212; \u0432 golang \u0435\u0441\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 (\u0442\u0430\u043a \u0436\u0435 \u0438\u0441\u0442\u043e\u0440\u0438\u044f, \u0447\u0442\u043e \u0438 \u0441 \u0440\u043e\u0443\u0442\u0435\u0440\u043e\u043c http &#8212; \u043e\u043d \u0435\u0441\u0442\u044c, \u043d\u043e \u0432\u0441\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438\u0437-\u0437\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u0443\u0442\u0435\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432). \u0418 \u0442\u0443\u0442 \u0437\u0430\u0441\u0430\u0434\u0430 &#8212; \u044d\u0442\u043e\u0442 rpc \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0436\u0434\u0443 golang \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u041f\u043e\u0442\u043e\u043c \u0432\u044b\u043a\u0430\u0442\u0438\u043b\u0438 gRPC \u0438 \u0432\u0441\u0435 \u0437\u0430\u0432\u0435\u0440\u0442\u0435&#8230; \u0412\u043a\u0440\u0430\u0442\u0446\u0435 &#8212; gRPC \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 http\/2 \u0438 protobuf \u0434\u043b\u044f \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 (\u0437\u0430\u043f\u043e\u043c\u043d\u0438\u043c, rpc &#8212; \u044d\u0442\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u043e\u0431\u043c\u0435\u043d\u0430 \u043f\u043b\u044e\u0441 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440). \u041f\u0440\u0438\u0447\u0435\u043c gRPC \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432, \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435\u0442 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438, \u043d\u0430 \u0447\u0435\u043c \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0443\u044e \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c. So far, so good&#8230;<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0435 \u0432\u0441\u0435 \u0442\u0430\u043a \u0433\u043b\u0430\u0434\u043a\u043e&#8230; \u041f\u043e\u043d\u044f\u0442\u043d\u043e \u0441\u0442\u0440\u0435\u043c\u043b\u0435\u043d\u0438\u0435 Google \u043e\u0431\u044a\u044f\u0442\u044c \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043a\u0435\u0439\u0441\u044b, \u043d\u043e! \u041a \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 gRPC \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u043a\u0443\u0447\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432. \u0418\u043d\u0430\u0447\u0435 \u043a\u0430\u043a \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u043a\u0443\u0447\u0430 \u043a\u043e\u043d\u0442\u043e\u0440 \u043d\u0430\u0447\u0430\u043b\u0438 \u043f\u0438\u043b\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 RPC (\u0438\/\u0438\u043b\u0438 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432)? \u0422\u0430\u043a\u0436\u0435, \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e, \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a RPC \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0431\u043b\u0430\u043a\u0430 (\u0447\u0438\u0442\u0430\u0439 \u043c\u0435\u0436\u0434\u0443 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438) \u0438 RPC \u043c\u0435\u0436\u0434\u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c\u0438 \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 \u043e\u0431\u043b\u0430\u043a\u0430\/\u0434\u0430\u0442\u0430\u0446\u0435\u043d\u0442\u0440\u0430 \u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u0433\u043e (\u0437\u0430 ingress\/proxy\/load balancer &#8212; \u043a\u0430\u043a \u0445\u043e\u0442\u0438\u0442\u0435 \u043d\u0430\u0437\u044b\u0432\u0430\u0439\u0442\u0435) \u043a\u0430\u043a \u0431\u044b &#171;\u043d\u0435\u043c\u043d\u043e\u0436\u043a\u043e&#187; \u0440\u0430\u0437\u043d\u044b\u0435? \u0414\u0430 \u0438 \u0432\u044b\u0431\u043e\u0440 http\/2 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u0430 &#8212; \u043d\u0443 \u043a\u0442\u043e-\u0436\u0435 \u0437\u043d\u0430\u043b, \u0447\u0442\u043e \u0432\u043d\u0435\u0434\u0440\u0451\u0436 \u043f\u043e\u0439\u0434\u0435\u0442 \u043d\u0435 \u0442\u0430\u043a (\u0431\u044b\u0441\u0442\u0440\u043e), \u043a\u0430\u043a \u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c.<\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432, \u043e\u0431\u0449\u0435\u043f\u0440\u0438\u0437\u043d\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0432\u043e\u0440\u0438\u0442 &#8212; <a href=\"https:\/\/github.com\/gogo\/protobuf\" rel=\"noopener noreferrer nofollow\">gogo\/protobuf<\/a> (\u0444\u043e\u0440\u043a <a href=\"https:\/\/github.com\/golang\/protobuf\" rel=\"noopener noreferrer nofollow\">golang\/protobuf<\/a>), \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u043a\u043e\u0434 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430 \u0441\u0447\u0435\u0442 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u043e\u0442\u043a\u0430\u0437\u0430 \u043e \u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u0438\/\u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0434\u0440\u0443\u0433\u0438\u0445 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0439, \u043d\u043e \u043f\u043e\u0441\u0442\u043e\u0439\u0442\u0435 &#8212; \u043e\u043d \u0436\u0435 Deprecated (\u0438 \u0442\u0435\u043f\u0435\u0440\u044c <a href=\"https:\/\/github.com\/gogo\/protobuf\/issues\/691\" rel=\"noopener noreferrer nofollow\">\u0438\u0449\u0443\u0442 new ownership<\/a>)? \u0410 \u044d\u0442\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 Google \u043d\u0430 <a href=\"https:\/\/go.dev\/blog\/protobuf-apiv2\" rel=\"noopener noreferrer nofollow\">protobuf API v2<\/a>, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 gogo \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u043b\u0438 \u0437\u0430\u0431\u0438\u0442\u044c \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442 (\u044d\u0442\u043e \u043f\u0440\u0438\u0441\u043a\u043e\u0440\u0431\u043d\u043e), \u0447\u0435\u043c \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0433\u043e \u043a\u043e\u0434 \u043f\u043e\u0447\u0442\u0438 \u0446\u0435\u043b\u0438\u043a\u043e\u043c. \u0425\u043e\u0442\u044f \u0432\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u043a \u0441 gogo \u043d\u0430 API v2 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043b\u0438 &#8212; <a href=\"https:\/\/giedrius.blog\/2022\/02\/04\/things-learned-from-trying-to-migrate-to-protobuf-v2-api-from-gogoprotobuf-so-far\/\" rel=\"noopener noreferrer nofollow\">Things Learned From Trying to Migrate To Protobuf V2 API from gogoprotobuf (So Far)<\/a>.<\/p>\n<p>\u041d\u043e \u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u044d\u043d\u0442\u0443\u0437\u0438\u0430\u0441\u0442\u044b &#8212; \u0437\u0430\u0446\u0435\u043d\u0438\u0442\u0435 <a href=\"https:\/\/github.com\/planetscale\/vtprotobuf\" rel=\"noopener noreferrer nofollow\">vtprotobuf<\/a>. \u041f\u0430\u0440\u043d\u0438 \u0438\u0437 <a href=\"https:\/\/vitess.io\/\" rel=\"noopener noreferrer nofollow\">Vitess<\/a> \u0437\u0430\u043c\u043e\u0440\u043e\u0447\u0438\u043b\u0438\u0441\u044c, \u0438 \u0442\u0430\u043a\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0441\u0432\u043e\u0439 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u043e\u0434 protobuf API v2, \u043f\u0440\u0438\u0447\u0438\u043d\u044b \u0438 \u0446\u0438\u0444\u0440\u044b \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 <a href=\"https:\/\/vitess.io\/blog\/2021-06-03-a-new-protobuf-generator-for-go\/\" rel=\"noopener noreferrer nofollow\">A new Protocol Buffers generator for Go<\/a>.<\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438 &#8212; \u043d\u0435 protobuf \u0435\u0434\u0438\u043d\u044b\u043c, \u043a\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430 \u0436\u0435 Google \u043a\u043e\u0433\u0434\u0430-\u0442\u043e \u0437\u0430\u043c\u0443\u0442\u0438\u043b\u0430 <a href=\"https:\/\/github.com\/google\/flatbuffers\" rel=\"noopener noreferrer nofollow\">flatbuffers <\/a>\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440. \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0442\u043e, \u0447\u0442\u043e gRPC \u0432\u043e\u043e\u0431\u0449\u0435-\u0442\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u044b, \u0430 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e protobuf \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438. \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <a href=\"https:\/\/dgraph.io\/\" rel=\"noopener noreferrer nofollow\">Dgraph<\/a> (\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u0438 \u043a\u0430\u043a \u0440\u0430\u0437 \u0441 net\/rpc \u0441 flatbuffers \u0432\u043c\u0435\u0441\u0442\u043e gob), \u0430 \u043f\u043e\u0442\u043e\u043c \u043f\u0435\u0440\u0435\u0448\u043b\u0438 \u043d\u0430 gRPC, \u043d\u043e \u0442\u043e\u0436\u0435 \u0441 flatbuffers &#8212; <a href=\"https:\/\/dgraph.io\/blog\/post\/rpc-vs-grpc\/\" rel=\"noopener noreferrer nofollow\">Custom encoding: Go implementation in net\/rpc vs grpc and why we switched<\/a>.<\/p>\n<p>\u0412\u043e\u043e\u0431\u0449\u0435, \u043a\u0430\u043a \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u043e\u0441\u044c \u0440\u0430\u043d\u0435\u0435 &#8212; \u0435\u0441\u0442\u044c 100500 \u0440\u0430\u0437\u043d\u044b\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 (\u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u044d\u0442\u043e \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u043d\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e golang), \u0432\u043e\u0442 <a href=\"https:\/\/github.com\/alecthomas\/go_serialization_benchmarks\" rel=\"noopener noreferrer nofollow\">github \u0440\u0435\u043f\u0430<\/a>, \u0433\u0434\u0435 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432\u0441\u0435\u0445 (\u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435) \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432 \u0434\u043b\u044f golang, \u043f\u0440\u0430\u0432\u0434\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0442\u0430\u043c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u043d\u0430 \u0441\u0435\u0439\u0447\u0430\u0441 (gob \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435 JSON &#8212; \u044d\u0442\u043e \u043a\u0430\u043a \u0432\u043e\u043e\u0431\u0449\u0435?), \u0435\u0441\u043b\u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u043f\u043e \u0433\u043e\u0434\u0430\u043c:<\/p>\n<p><a href=\"https:\/\/github.com\/alecthomas\/go_serialization_benchmarks\/blob\/d7f2120213c6af6153a9b71f27eb27e428ec1423\/README.md\" rel=\"noopener noreferrer nofollow\">2022\/09\/05 &#8212; Go 1.16.5 linux\/amd64 i7-3630QM<\/a><\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"center\"><strong>benchmark<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>iter<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"center\"><strong>time\/iter<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"center\"><strong>bytes\/op<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>allocs\/op<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Json_Marshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">189709<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">6090<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">151<\/p>\n<\/td>\n<td>\n<p align=\"right\">208<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Json_Unmarshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">92833<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">12751<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">151<\/p>\n<\/td>\n<td>\n<p align=\"right\">383<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Gob_Marshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">71692<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">16463<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">163<\/p>\n<\/td>\n<td>\n<p align=\"right\">1616<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Gob_Unmarshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">14772<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">84385<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">163<\/p>\n<\/td>\n<td>\n<p align=\"right\">7688<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Goprotobuf_Marshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">1405010<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">854<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">53<\/p>\n<\/td>\n<td>\n<p align=\"right\">64<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Goprotobuf_Unmarshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">973688<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">1255<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">53<\/p>\n<\/td>\n<td>\n<p align=\"right\">168<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Gogoprotobuf_Marshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">3359550<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">354<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">53<\/p>\n<\/td>\n<td>\n<p align=\"right\">64<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Gogoprotobuf_Unmarshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">1908633<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">619<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">53<\/p>\n<\/td>\n<td>\n<p align=\"right\">96<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Musgo_Marshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">4294477<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">280<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">46<\/p>\n<\/td>\n<td>\n<p align=\"right\">48<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Musgo_Unmarshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">2498404<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">480<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">46<\/p>\n<\/td>\n<td>\n<p align=\"right\">96<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><a href=\"https:\/\/github.com\/alecthomas\/go_serialization_benchmarks\/blob\/6f010e2a1cfe9cfa584fa261929e49f7fd7fd26b\/README.md\" rel=\"noopener noreferrer nofollow\">2021\/06\/21 &#8212; Go 1.16.5 linux\/amd64 i7-3630QM<\/a><\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"center\"><strong>benchmark<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>iter<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"center\"><strong>time\/iter<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"center\"><strong>bytes\/op<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>allocs\/op<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Json_Marshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">501478<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">2538<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">151<\/p>\n<\/td>\n<td>\n<p align=\"right\">208<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Json_Unmarshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">226456<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">5023<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">151<\/p>\n<\/td>\n<td>\n<p align=\"right\">383<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Gob_Marshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">1320562<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">882<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">63<\/p>\n<\/td>\n<td>\n<p align=\"right\">40<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Gob_Unmarshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">1000000<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">1041<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">63<\/p>\n<\/td>\n<td>\n<p align=\"right\">112<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Goprotobuf_Marshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">3247056<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">378<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">53<\/p>\n<\/td>\n<td>\n<p align=\"right\">64<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Goprotobuf_Unmarshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">1839267<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">651<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">53<\/p>\n<\/td>\n<td>\n<p align=\"right\">168<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Gogoprotobuf_Marshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">5886194<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">204<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">53<\/p>\n<\/td>\n<td>\n<p align=\"right\">64<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Gogoprotobuf_Unmarshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">3464098<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">345<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">53<\/p>\n<\/td>\n<td>\n<p align=\"right\">96<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Musgo_Marshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">12882543<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">86<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">0<\/p>\n<\/td>\n<td>\n<p align=\"right\">0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Musgo_Unmarshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">3381966<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">343<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">96<\/p>\n<\/td>\n<td>\n<p align=\"right\">96<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0412 \u0434\u0440\u0443\u0433\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u043d\u0430\u0448\u043b\u0438\u0441\u044c \u0431\u043e\u043b\u0435\u0435 &#171;\u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u044b\u0435&#187; \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b:<\/p>\n<p><a href=\"https:\/\/morioh.com\/p\/0ba142bf20f3\" rel=\"noopener noreferrer nofollow\">2022\/03\/19 Go 1.17.8 Darwin\/arm64 Apple M1 Max<\/a><\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"center\"><strong>benchmark<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>iter<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"center\"><strong>time\/iter<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"center\"><strong>bytes\/op<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>allocs\/op<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Json_Marshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">1440837<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">822<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">148<\/p>\n<\/td>\n<td>\n<p align=\"right\">208<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Json_Unmarshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">653754<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">1817<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">148<\/p>\n<\/td>\n<td>\n<p align=\"right\">399<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Gob_Marshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\"> 2750721<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">440<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">63<\/p>\n<\/td>\n<td>\n<p align=\"right\">40<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Gob_Unmarshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">2918254<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">410<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">63<\/p>\n<\/td>\n<td>\n<p align=\"right\">112<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Goprotobuf_Marshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">6831308<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">176<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">53<\/p>\n<\/td>\n<td>\n<p align=\"right\">64<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Goprotobuf_Unmarshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">5746256<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">210<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">53<\/p>\n<\/td>\n<td>\n<p align=\"right\">168<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Gogoprotobuf_Marshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">16528346<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">72<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">53<\/p>\n<\/td>\n<td>\n<p align=\"right\">64<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Gogoprotobuf_Unmarshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">12764978<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">94<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">53<\/p>\n<\/td>\n<td>\n<p align=\"right\">96<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Musgo_Marshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">22535546<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">53<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">48<\/p>\n<\/td>\n<td>\n<p align=\"right\">0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"315\" width=\"315\">\n<p align=\"left\">Musgo_Unmarshal-8<\/p>\n<\/td>\n<td>\n<p align=\"right\">12952696<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">90<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p align=\"right\">48<\/p>\n<\/td>\n<td>\n<p align=\"right\">96<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0412 \u043e\u0431\u0449\u0435\u043c, gogo \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0432 \u0434\u0432\u0430 \u0440\u0430\u0437\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0442 Google. \u041a\u0441\u0442\u0430\u0442\u0438, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043d\u0435\u043a\u0438\u0439 <a href=\"https:\/\/github.com\/ymz-ncnk\/musgo\" rel=\"noopener noreferrer nofollow\">musgo<\/a> &#8212; \u043e\u0447\u0435\u043d\u044c \u0434\u0430\u0436\u0435 \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0441\u0435\u0431\u044f \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 (\u0438\u0431\u043e codegen). \u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441\u0442\u043e\u0438\u043b\u043e \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 <a href=\"https:\/\/msgpack.org\/\" rel=\"noopener noreferrer nofollow\">msgpack<\/a> &#8212; \u043f\u0440\u043e\u0435\u043a\u0442 \u043e\u0442 opensource \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0441\u0435 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0432\u0437\u043b\u0435\u0442\u0438\u0442 \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0443\u0435\u0442 (\u043d\u043e \u043f\u043e\u0434\u0432\u0438\u0436\u043a\u0438 \u0432\u0440\u043e\u0434\u0435 \u0435\u0441\u0442\u044c). \u0414\u043b\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0447\u0442\u0435\u043d\u0438\u044f &#8212; <a href=\"https:\/\/habr.com\/ru\/company\/scalablesolutions\/blog\/672840\/\" rel=\"noopener noreferrer nofollow\">\u0417\u043e\u043e\u043f\u0430\u0440\u043a \u0432 Golang MSA. Protobuf, MessagePack, Gob \u2013 \u0447\u0442\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c?<\/a><\/p>\n<p>\u0418\u0434\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435. \u0412\u0441\u0435 \u0447\u0430\u0449\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u044b \u0437\u0430\u0434\u0430\u044e\u0442\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c, \u0430 \u0447\u043e\u0439-\u0442\u0430 golang gRPC \u0442\u0430\u043a\u043e\u0439 \u043c\u043e\u043d\u0441\u0442\u0440\u0443\u043e\u0437\u043d\u044b\u0439 \u0432 \u043f\u043b\u0430\u043d\u0435 \u043e\u0432\u0435\u0440\u0445\u0435\u0434\u0430 \u043d\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438? \u0418 \u043f\u043e\u0447\u0435\u043c\u0443 \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u0443 \u043d\u0435\u0433\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f http\/2 \u0441\u0442\u0435\u043a\u0430, \u0430 \u043d\u0435 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u0430 &#171;golang.org\/x\/net\/http2&#187; (\u043d\u0443 \u0434\u0430, \u0442\u0438\u043f\u044b \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u0438\u0437 \u043d\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f, \u043d\u043e \u043d\u0435 \u0431\u043e\u043b\u0435\u0435). \u0418 \u0432\u043e\u043e\u0431\u0449\u0435 &#8212; \u043d\u0435 \u0442\u0430\u043a \u0432\u0441\u0435 \u0433\u043b\u0430\u0434\u043a\u043e \u0441 \u043f\u0440\u043e\u0431\u0440\u043e\u0441\u043e\u043c http\/2 \u0447\u0435\u0440\u0435\u0437 load balancers.<\/p>\n<p>\u0414\u0430\u0431\u044b \u0440\u0435\u0448\u0438\u0442\u044c \u0434\u0432\u0435 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b &#8212; \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043e\u0434\u0430 (\u0447\u0438\u0442\u0430\u0439, \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0439 \u0432\u043e\u0439\u043d\u044b \u0441 \u0431\u0430\u0433\u0430\u043c\u0438 \u0438 breaking changes, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 Google, \u0432\u0438\u0434\u0438\u043c\u043e &#8212; &#171;\u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0435&#187; \u044f\u0432\u043b\u0435\u043d\u0438\u0435) \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 http 1.1, \u0432 <a href=\"https:\/\/www.twitch.tv\/\" rel=\"noopener noreferrer nofollow\">Twitch<\/a> \u0437\u0430\u043f\u0438\u043b\u0438\u043b\u0438 \u0441\u0432\u043e\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a <a href=\"https:\/\/github.com\/twitchtv\/twirp\" rel=\"noopener noreferrer nofollow\">Twirp<\/a> (\u043a\u0441\u0442\u0430\u0442\u0438, http\/2 \u0442\u043e\u0436\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 golang) &#8212; <a href=\"https:\/\/blog.twitch.tv\/en\/2018\/01\/16\/twirp-a-sweet-new-rpc-framework-for-go-5f2febbf35f\/\" rel=\"noopener noreferrer nofollow\">Twirp: a sweet new RPC framework for Go<\/a>, \u043e \u043d\u0435\u043c \u0438 \u043d\u0430 Habr \u0442\u043e\u0436\u0435 \u043f\u0438\u0441\u0430\u043b\u043e\u0441\u044c &#8212; <a href=\"https:\/\/habr.com\/ru\/post\/354706\/\" rel=\"noopener noreferrer nofollow\">Twirp \u043f\u0440\u043e\u0442\u0438\u0432 gRPC. \u0421\u0442\u043e\u0438\u0442 \u043b\u0438?<\/a><\/p>\n<p>\u041f\u043e \u0442\u0435\u043c \u0436\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c \u0432 <a href=\"https:\/\/www.storj.io\/\" rel=\"noopener noreferrer nofollow\">Storj<\/a> \u0442\u043e\u0436\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0441\u0432\u043e\u044e \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0443 gRPC &#8212; <a href=\"https:\/\/github.com\/storj\/drpc\" rel=\"noopener noreferrer nofollow\">DRPC<\/a>, \u0441\u043c. \u0441\u0442\u0430\u0442\u044c\u044e <a href=\"https:\/\/www.storj.io\/blog\/introducing-drpc-our-replacement-for-grpc\" rel=\"noopener noreferrer nofollow\">Introducing DRPC: Our Replacement for gRPC<\/a>, \u043f\u0440\u0438\u0447\u0435\u043c \u043e\u043d\u0438 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u0438 Twirp, \u043a\u0430\u043a \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043d\u043e \u0432 \u043d\u0435\u043c \u043d\u0435 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043d\u0443\u0436\u043d\u043e\u0439 \u0444\u0438\u0447\u0438 &#8212; \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u0430 (\u043a\u0430\u043a \u0432 gRPC), \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432 DRPC \u0442\u043e\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438.<\/p>\n<p>\u041f\u043e\u0441\u0442\u043e\u0439\u0442\u0435-\u043a\u0430, \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u0432\u0441\u0435 \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440\u044b \u0432\u0435\u043b\u0438\u0441\u044c \u043e RPC \u043c\u0435\u0436\u0434\u0443, \u0443\u0441\u043b\u043e\u0432\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u043e\u0431\u043b\u0430\u043a\u043e\u043c \u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c\u0438 \u043d\u0430 PC\/Mobile. \u0410 \u0437\u0430\u0447\u0435\u043c \u0442\u0430\u043a\u0438\u0435 \u043d\u0430\u0432\u043e\u0440\u043e\u0442\u044b \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432? \u041f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 plain TCP (\u0438\u043b\u0438 \u0434\u0430\u0436\u0435 UDP, \u0432 \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u0438\u0433\u0440\u0443\u0448\u043a\u0430\u0445 \u0442\u0430\u043a \u0434\u0435\u043b\u0430\u044e\u0442 \u0438\u043d\u043e\u0433\u0434\u0430)? \u0410\u0445, \u0434\u0430 &#8212; net\/rpc \u0436\u0435 \u0435\u0441\u0442\u044c (\u0447\u0442\u043e \u0432\u0430\u043c \u0435\u0449\u0435 \u043d\u0443\u0436\u043d\u043e-\u0442\u043e, \u043a\u0430\u043a \u0431\u044b \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 Google).<\/p>\n<p>\u041d\u0443\u0436\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u0444\u0438\u0447! \u0422\u0430\u043a \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <a href=\"https:\/\/github.com\/valyala\/gorpc\" rel=\"noopener noreferrer nofollow\">valyala\/gorpc<\/a>, \u0430 \u0437\u0430\u0442\u0435\u043c \u0438 <a href=\"https:\/\/github.com\/valyala\/fastrpc\" rel=\"noopener noreferrer nofollow\">valyala\/fastrpc<\/a> \u043e\u0442 \u0410\u043b\u0435\u043a\u0441\u0430\u043d\u0434\u0440\u0430 \u0412\u0430\u043b\u044f\u043b\u043a\u0438\u043d\u0430, \u0430\u0432\u0442\u043e\u0440\u0430 <a href=\"https:\/\/github.com\/valyala\/fasthttp\" rel=\"noopener noreferrer nofollow\">fasthttp<\/a> (\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0440\u043e \u043d\u0435\u0451 \u0442\u0443\u0442 \u043d\u0430 Habr &#8212; <a href=\"https:\/\/habr.com\/ru\/post\/509240\/\" rel=\"noopener noreferrer nofollow\">\u0413\u0440\u0435\u0445\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438<\/a>).<\/p>\n<p>\u041f\u0440\u0438 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0438 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 RPC \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u043c\u043d\u043e\u0433\u043e (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"https:\/\/github.com\/smallnest\/rpcx\" rel=\"noopener noreferrer nofollow\">rpcx<\/a>, <a href=\"https:\/\/github.com\/cloudwego\/kitex\" rel=\"noopener noreferrer nofollow\">kitex<\/a>, <a href=\"https:\/\/github.com\/lesismal\/arpc\" rel=\"noopener noreferrer nofollow\">arpc<\/a>, \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0438\u0445 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441 gRPC \u0438 net\/rpc &#8212; <a href=\"https:\/\/www.sobyte.net\/post\/2022-08\/go-rpc-frameworks\/\" rel=\"noopener noreferrer nofollow\">2022 Go Ecosystem rpc Framework Benchmark<\/a>), \u043d\u043e \u043d\u0430 \u0441\u043b\u0443\u0445\u0443 \u0443 \u0432\u0441\u0435\u0445 gRPC \u043a\u0430\u043a \u043d\u0435\u043a\u0430\u044f &#171;\u0441\u0435\u0440\u0435\u0431\u0440\u044f\u043d\u0430\u044f \u043f\u0443\u043b\u044f&#187;.<\/p>\n<p>\u0418 \u043f\u0440\u043e UDP based RPC &#8212; \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 Hprose (High Performance Remote Object Service Engine) \u043e\u0442 \u043a\u0438\u0442\u0430\u0439\u0441\u043a\u0438\u0445 \u0442\u043e\u0432\u0430\u0440\u0438\u0449\u0435\u0439, \u043e\u043d \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432, \u0438 \u0434\u043b\u044f <a href=\"https:\/\/github.com\/hprose\/hprose-golang\" rel=\"noopener noreferrer nofollow\">golang \u0442\u043e\u0436\u0435 \u0435\u0441\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/a>, \u0442\u0430\u043a \u0432\u043e\u0442 &#8212; \u0442\u0430\u043c \u0435\u0441\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 UDP. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432\u044b\u0448\u0435\u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0439 rpcx \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 TCP, HTTP, <a href=\"https:\/\/en.wikipedia.org\/wiki\/QUIC\" rel=\"noopener noreferrer nofollow\">QUIC<\/a> (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c UDP) and <a href=\"https:\/\/github.com\/skywind3000\/kcp\/blob\/master\/README.en.md\" rel=\"noopener noreferrer nofollow\">KCP<\/a> (\u0442\u0430\u043a \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0438\u0442\u0430\u0439\u0441\u043a\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 QUIC, \u0442\u043e\u0436\u0435 \u043d\u0430 UDP).<\/p>\n<p>\u041d\u0443 \u0438 \u043d\u0430\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a, \u043a \u0432\u043e\u043f\u0440\u043e\u0441\u0443 \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 gRPC \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c&#8230; \u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0435\u0433\u043e \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c. \u0422\u0443\u0442 \u0432\u043e\u0442 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0441\u043b\u043e\u0443\u043f\u043e\u043a\u0438 \u043f\u0438\u0448\u0443\u0442 \u0432 2022 \u0433\u043e\u0434\u0443-\u0442\u043e <a href=\"https:\/\/ably.com\/blog\/grpc-stream-performance\" rel=\"noopener noreferrer nofollow\">The Mysterious Gotcha of gRPC Stream Performance<\/a>, \u0443 \u043d\u0430\u0441 \u0442\u0430\u043a\u043e\u0439 \u0442\u0440\u044e\u043a \u0432 PROD \u0443\u0436\u0435 \u0433\u043e\u0434\u0430 4 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f: \u043a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0432 gRPC \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u0438 \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u043e\u0432\u044b\u0435, \u0442\u0430\u043a \u0432\u043e\u0442 &#8212; \u0435\u0441\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0443\u043b \u0441\u0442\u0440\u0438\u043c\u043e\u0432 \u0432\u043c\u0435\u0441\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430, \u0442\u043e \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432 \u0434\u0432\u0430 \u0440\u0430\u0437\u0430 (\u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0438\u043b\u0438 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043d\u044b\u043c\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438 &#8212; \u043d\u0435\u0432\u0430\u0436\u043d\u043e), \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<p><strong>api.proto<\/strong><\/p>\n<pre><code class=\"go\">syntax = \"proto3\";  package pb  message Request {} message Response {}  service Service {   rpc Unary (Request) returns (Response);   rpc Stream (stream Request) returns (stream Response); }<\/code><\/pre>\n<p><strong>server.go<\/strong><\/p>\n<pre><code class=\"go\">func (s *grpcServer) Unary(ctx context.Context, req *pb.Request) (*pb.Response, error) { return &amp;pb.ResponseDomain{}, nil }  func (s *grpcServer) Stream(stream pb.Service_StreamServer) error { ctx := stream.Context() for { select { case &lt;-ctx.Done(): return ctx.Err() default: }  req, err := stream.Recv() if err == io.EOF { break }  if err != nil { return err }  resp, _ := s.Unary(ctx, req) if err := stream.Send(resp); err != nil { return err } } return nil }<\/code><\/pre>\n<p><strong>client.go<\/strong><\/p>\n<pre><code class=\"go\">func (c *grpcClient) Call(ctx context.Context, req *pb.Request) (*pb.Response, error) { if !c.streams { return c.client.Unary(ctx, req) }  stream := c.getStreamFromPool() if stream == nil { return nil, fmt.Errorf(\"no stream\") }  if err := stream.Send(req); err != nil { stream, err = c.client.Stream(ctx) if err != nil { return nil, err } }  defer c.putStreamToPool(stream) return stream.Recv() }<\/code><\/pre>\n<p>\u041d\u043e \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u044d\u0442\u043e c\u043b\u043e\u043c\u0430\u0435\u0442\u0441\u044f (\u0445\u043e\u0442\u044f \u044d\u0442\u043e \u0445\u0430\u043a, \u043a\u0430\u043a \u043d\u0438 \u043a\u0440\u0443\u0442\u0438), \u0438\u043d\u0430\u0447\u0435 \u0442\u0430\u043a\u0438\u0445 <a href=\"https:\/\/twitter.com\/dave_universetf\/status\/1399585509765042181\" rel=\"noopener noreferrer nofollow\">\u0442\u0432\u0438\u0442\u043e\u0432<\/a> \u0431\u044b \u043d\u0435 \u0431\u044b\u043b\u043e, \u044f \u0434\u0443\u043c\u0430\u044e.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/688756\/\"> https:\/\/habr.com\/ru\/post\/688756\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-338462","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/338462","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=338462"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/338462\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=338462"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=338462"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=338462"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}