Skip to content

Convert fully to protobuf (was partially JSON) #402

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

Merged
merged 3 commits into from
Apr 2, 2019
Merged

Conversation

code-asher
Copy link
Member

@code-asher code-asher commented Apr 2, 2019

This removes all the stringifying and parsing of JSON and uses protobuf directly for everything.

Still need to run some benchmarks.

Closes #390.

@code-asher code-asher requested a review from kylecarbs as a code owner April 2, 2019 00:23
@code-asher code-asher added the wip label Apr 2, 2019
@code-asher code-asher force-pushed the perf/json-to-proto branch from 71a2070 to ab4dec3 Compare April 2, 2019 16:54
@code-asher code-asher force-pushed the perf/json-to-proto branch from ab4dec3 to 1e0d995 Compare April 2, 2019 16:57
@code-asher
Copy link
Member Author

code-asher commented Apr 2, 2019

https://plot.ly/~code-asher/6

The takeaway:

  • Using 100% proto is much improved over using JSON inside of proto.
  • JSON-only is more performant for buffers < 128 bytes.
  • Base64 over proto is more performant when < 64 bytes.
  • Base64 over JSON is the most performant (by a pretty significant margin).

Notes:

  • Each result is an average of however many runs could complete in 10 seconds.
  • Tests were ran entirely in Node; browser results could be different.
  • The only thing tested was the time it takes to serialize a buffer and then immediately deserialize it (or stringify/parse/encode/decode as the case may be).

@code-asher code-asher force-pushed the perf/json-to-proto branch from 4e75108 to 616951f Compare April 2, 2019 21:12
@code-asher code-asher removed the wip label Apr 2, 2019
@kylecarbs kylecarbs merged commit 3a672d7 into master Apr 2, 2019
@kylecarbs kylecarbs deleted the perf/json-to-proto branch April 2, 2019 22:44
code-asher added a commit that referenced this pull request Jun 19, 2019
* Convert fully to protobuf (was partially JSON)

* Handle all floating promises

* Remove stringified proto from trace logging

It wasn't proving to be very useful.
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

Successfully merging this pull request may close these issues.

2 participants