This is a simple code size comparison between Connect-Web and gRPC-web.
We are generating code for the module buf.build/bufbuild/eliza
once with protoc-gen-grpc-web
, once with protoc-gen-connect-web
.
Then we bundle a client for the service buf.connect.demo.eliza.v1.ElizaService
with esbuild, minify the bundle, and compress
it like a web server would usually do.
code generator | bundle size | minified | compressed |
---|---|---|---|
connect-web | 87,973 b | 41,027 b | 11,368 b |
grpc-web | 394,473 b | 283,740 b | 51,793 b |