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

protons-runtime 5.x is 2x slower than protons-runtime 3.x #109

Open
twoeths opened this issue Aug 13, 2023 · 1 comment
Open

protons-runtime 5.x is 2x slower than protons-runtime 3.x #109

twoeths opened this issue Aug 13, 2023 · 1 comment

Comments

@twoeths
Copy link
Contributor

twoeths commented Aug 13, 2023

This is the proto file https://github.com/ChainSafe/js-libp2p-gossipsub/blob/v10.0.0/src/message/rpc.proto

This is the testing code https://github.com/ChainSafe/js-libp2p-gossipsub/blob/v10.0.0/test/benchmark/protobuf.test.ts

With protons-runtime v3 I got:

protobuf
    ✔ decode Attestation message                      3446018 ops/s    290.1900 ns/op        -    2053201 runs   60.1 s
    ✔ encode Attestation message                       2506831 ops/s    398.9100 ns/op        -    1492091 runs   60.0 s

with protons-runtime v5 I got:

protobuf
    ✔ decode Attestation message using protons 5.1.0                       1645793 ops/s    607.6100 ns/op        -     983127 runs   60.1 s
    ✔ encode Attestation message using protons 5.1.0                       1630497 ops/s    613.3100 ns/op        -     972079 runs   60.0 s
@achingbrain
Copy link
Member

achingbrain commented Oct 13, 2023

I've created a repo so we can track this over time: https://github.com/ipfs-shipyard/protons-gossipsub-benchmark

Currently the latest version of protons is quite a bit slower encoding gossipsub RPC messages but is comparable when decoding them (node.js v20.8.0, M1 Max macOS 13.5.1).

cc: @wemeetagain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants