-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update bundle-size benchmark (#1151)
- Loading branch information
Showing
187 changed files
with
79,350 additions
and
1,666 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,29 @@ | ||
# Code size comparison | ||
|
||
This is a simple code size comparison between Connect-Web and gRPC-web. | ||
|
||
We are generating code for the module [buf.build/connectrpc/eliza](https://buf.build/connectrpc/eliza) | ||
once with `protoc-gen-grpc-web`, once with `protoc-gen-connect-es`. | ||
Then we bundle a client for the service `connectrpc.eliza.v1.ElizaService` | ||
with [esbuild](https://esbuild.github.io/), minify the bundle, and compress | ||
it like a web server would usually do. | ||
|
||
| code generator | bundle size | minified | compressed | | ||
|----------------|-------------------:|-----------------------:|---------------------:| | ||
| connect | 125,130 b | 54,845 b | 14,767 b | | ||
| grpc-web | 415,212 b | 300,936 b | 53,420 b | | ||
This is a simple code size comparison between Connect-ES and [gRPC-web](https://github.com/grpc/grpc-web). | ||
|
||
We are generating code for the module [buf.build/bufbuild/registry](https://buf.build/bufbuild/registry) | ||
once with gRPC-web, once with Connect-ES. Then we bundle a client calling an RPC | ||
with [esbuild](https://esbuild.github.io/), minify the bundle, and compress it like a web server would | ||
usually do. We repeat this for an increasing number of RPCs. | ||
|
||
![chart](./chart.svg) | ||
|
||
<details><summary>Tabular data</summary> | ||
|
||
<!-- TABLE-START --> | ||
|
||
| code generator | RPCs | bundle size | minified | compressed | | ||
| -------------- | ---: | ----------: | --------: | ---------: | | ||
| Connect-ES | 1 | 152,637 b | 66,472 b | 16,369 b | | ||
| Connect-ES | 4 | 168,079 b | 72,412 b | 16,863 b | | ||
| Connect-ES | 8 | 193,392 b | 82,136 b | 17,475 b | | ||
| Connect-ES | 16 | 227,031 b | 96,402 b | 18,225 b | | ||
| gRPC-Web | 1 | 876,563 b | 548,495 b | 52,300 b | | ||
| gRPC-Web | 4 | 928,964 b | 580,477 b | 54,673 b | | ||
| gRPC-Web | 8 | 1,004,833 b | 628,223 b | 57,118 b | | ||
| gRPC-Web | 16 | 1,124,155 b | 701,232 b | 61,248 b | | ||
|
||
<!-- TABLE-END --> | ||
|
||
</details> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,21 @@ | ||
version: v1 | ||
# Learn more: https://buf.build/docs/configuration/v2/buf-gen-yaml | ||
version: v2 | ||
plugins: | ||
- plugin: es | ||
- local: protoc-gen-es | ||
out: src/gen/connectweb | ||
opt: ts_nocheck=false,target=ts | ||
- plugin: connect-es | ||
include_imports: true | ||
- local: protoc-gen-connect-es | ||
out: src/gen/connectweb | ||
opt: ts_nocheck=false,target=ts | ||
- plugin: buf.build/protocolbuffers/js:v3.21.2 | ||
- remote: buf.build/protocolbuffers/js:v3.21.4 | ||
out: src/gen/grpcweb | ||
opt: import_style=commonjs | ||
- plugin: buf.build/grpc/web:v1.5.0 | ||
include_imports: true | ||
- remote: buf.build/grpc/web:v1.5.0 | ||
out: src/gen/grpcweb | ||
opt: import_style=commonjs+dts,mode=grpcweb | ||
- local: ["tsx", "./src/protoc-gen-entrypoints.ts"] | ||
strategy: all | ||
opt: target=ts | ||
out: src/gen |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
129 changes: 129 additions & 0 deletions
129
packages/connect-web-bench/src/gen/connectweb/buf/registry/module/v1/commit_pb.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.