Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve safety when generating field code #40

Merged
merged 1 commit into from
Dec 1, 2022

Conversation

piotr-oles
Copy link
Owner

@piotr-oles piotr-oles commented Dec 1, 2022

This is a part of a bigger project to move away from namespaces.

📦 Published PR as canary version: 0.9.2--canary.40.a1f0e0f.0

✨ Test out this PR locally via:

npm install as-proto-gen@0.9.2--canary.40.a1f0e0f.0
npm install as-proto@0.9.2--canary.40.a1f0e0f.0
# or 
yarn add as-proto-gen@0.9.2--canary.40.a1f0e0f.0
yarn add as-proto@0.9.2--canary.40.a1f0e0f.0

@piotr-oles piotr-oles self-assigned this Dec 1, 2022
@piotr-oles piotr-oles added the skip-release Preserve the current version when merged label Dec 1, 2022
@github-actions
Copy link

github-actions bot commented Dec 1, 2022

Benchmark results:

yarn run v1.22.19
$ yarn bench:prepare && yarn bench:run
$ node bench/prepare.js
Generating AssemblyScript protobuf file...
Building AssemblyScript bench file...
$ node bench/index.cjs
benchmarking encoding performance ...

as-proto x 1,144,012 ops/sec ±0.21% (97 runs sampled)
protobuf.js x 561,269 ops/sec ±0.41% (93 runs sampled)
JSON x 448,870 ops/sec ±0.19% (96 runs sampled)
google-protobuf x 293,855 ops/sec ±15.04% (92 runs sampled)

               as-proto was fastest
            protobuf.js was 51.0% ops/sec slower (factor 2.0)
                   JSON was 60.8% ops/sec slower (factor 2.5)
        google-protobuf was 77.6% ops/sec slower (factor 4.5)

benchmarking decoding performance ...

as-proto x 909,567 ops/sec ±0.33% (94 runs sampled)
protobuf.js x 1,354,582 ops/sec ±0.09% (97 runs sampled)
JSON x 434,804 ops/sec ±0.77% (97 runs sampled)
google-protobuf x 289,600 ops/sec ±0.42% (98 runs sampled)

            protobuf.js was fastest
               as-proto was 33.0% ops/sec slower (factor 1.5)
                   JSON was 68.1% ops/sec slower (factor 3.1)
        google-protobuf was 78.7% ops/sec slower (factor 4.7)

benchmarking combined performance ...

as-proto x 511,351 ops/sec ±0.15% (99 runs sampled)
protobuf.js x 383,486 ops/sec ±0.56% (95 runs sampled)
JSON x 194,890 ops/sec ±1.12% (91 runs sampled)
google-protobuf x 149,016 ops/sec ±0.12% (97 runs sampled)

               as-proto was fastest
            protobuf.js was 25.3% ops/sec slower (factor 1.3)
                   JSON was 62.3% ops/sec slower (factor 2.6)
        google-protobuf was 70.9% ops/sec slower (factor 3.4)

Done in 72.47s.

@piotr-oles piotr-oles merged commit 2848007 into main Dec 1, 2022
@github-actions
Copy link

github-actions bot commented Dec 8, 2022

🚀 PR was released in v0.9.2 🚀

@github-actions github-actions bot added the released This issue/pull request has been released. label Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released This issue/pull request has been released. skip-release Preserve the current version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant