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

encoding/decoding performance #113

Open
cometkim opened this issue Oct 10, 2021 · 0 comments
Open

encoding/decoding performance #113

cometkim opened this issue Oct 10, 2021 · 0 comments

Comments

@cometkim
Copy link
Member

cometkim commented Oct 10, 2021

Moved from #112

pbkit currently has very bad performance at encoding/decoding messages (~20 times worse than protobufjs)

pbkit encode      x  41,223 ops/sec ±0.35% (93 runs sampled)
protobufjs encode x 843,774 ops/sec ±0.51% (93 runs sampled)

pbkit decode      x  36,165 ops/sec ±0.94% (91 runs sampled)
protobufjs decode x 281,256 ops/sec ±0.40% (93 runs sampled)

It seems obvious that the Long constructor (dark-blue part in below screenshot), which does a lot of unnecessary work, is the bottleneck most of the time.

image
(left: pbkit, right: protobufjs)

image
(Bottom up chart)

You can check detail from this cpu profile snapshots:

pbkit-benchmarks-cpuprofiles.zip

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

1 participant