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

improve cbor performance #27

Closed
yusefnapora opened this issue Oct 14, 2016 · 1 comment
Closed

improve cbor performance #27

yusefnapora opened this issue Oct 14, 2016 · 1 comment

Comments

@yusefnapora
Copy link
Contributor

node-cbor is pretty slow 😞, about 20x slower than tinycbor at converting json to cbor.

Improving this probably means using tinycbor or another native code solution, which could go a few different ways:

  • write a command line app to pipe json through and get CBOR maps out the other end
    • don't need to mess with FFI
    • need to figure out how to delimit objects in the output
    • IPLD transform needs to be in native code for tag handling
    • could be used by any language (go, etc)
    • can spawn multiple concurrent processes
  • write a C addon or use node-ffi to wrap a native cbor lib
    • FFI is tricky, could potentially crash the node process
    • gives us more flexibility (can expose CBOR tags, etc)
    • no IPC overhead, but blocks the JS thread unless we get fancy with async code
  • (crazy option) try to compile tinycbor to webassembly and run node with the --expose-wasm flag 😄
@parkan
Copy link
Contributor

parkan commented Dec 16, 2016

Turns out you can optimize pure js enough!

@parkan parkan closed this as completed Dec 16, 2016
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