From 2a51a11c3d012e512d580e3daf39ef4c8ea9f83d Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Wed, 27 Sep 2023 16:15:03 -0400 Subject: [PATCH] Make --- packages/protobuf-bench/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 packages/protobuf-bench/README.md 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 |