diff --git a/packages/protobuf-bench/README.md b/packages/protobuf-bench/README.md new file mode 100644 index 000000000..1181c3d39 --- /dev/null +++ b/packages/protobuf-bench/README.md @@ -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 |