-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
14 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Code size comparison | ||
|
||
This is a simple code size comparison between protobuf-es and google-protobuf. | ||
|
||
We are generating code for the module [buf.build/bufbuild/buf](https://buf.build/bufbuild/buf) | ||
once with `protoc-gen-js` from [github.com/protocolbuffers/protobuf-javascript](https://github.com/protocolbuffers/protobuf-javascript), | ||
once with `protoc-gen-es` from Protobuf-ES. Then we bundle a [snippet of code](./src) | ||
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 | | ||
|---------------------|------------------------:|-----------------------:|-------------------:| | ||
| protobuf-es | 89,648 b | 37,862 b | 9,699 b | | ||
| protobuf-javascript | 394,384 b | 288,653 b | 45,140 b | |