Skip to content

Commit

Permalink
make bench
Browse files Browse the repository at this point in the history
  • Loading branch information
timostamm committed Oct 6, 2023
1 parent 452357c commit b69abcc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/protobuf-bench/README.md
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 |

0 comments on commit b69abcc

Please sign in to comment.