-
Notifications
You must be signed in to change notification settings - Fork 26
Encoding performance #23
Comments
Hey @parkan have you looked into this again? Would love to see some benchmarks of tinycbor compiled with asm.js. |
@diasdavid will hopefully have something next week! |
@parkan I have started looking into optimizing cbor encoding and decoding. Could you share your benchmark that you ran? I would like to see how close I can get in JavaScript. |
Current results, node-cbor is the default what we currently use and fast-cbor are my optimizations. Every run consists of encoding 83 small objects to cbor with most of the possible values being used.
|
Getting faster,
work is happening here: https://github.com/dignifiedquire/node-cbor/tree/perf |
Some new numbers are in
so things are starting to look pretty good :) |
Hi @dignifiedquire, very happy to see those numbers! Don't have the benchmark around but the difference was something like ~700 ops/s node-cbor vs ~16000 ops/s with tinycbor (under node 6.x) so this is certainly in the ballpark. Glanced over your branch, I see a bunch of savings through precalculating buffer size and allocating once -- nice. Curious, what tooling do you use for profling/benches/etc? |
Moved code to https://github.com/dignifiedquire/fast-cbor |
@parkan will do a write up of techniques and things I used when it's ready to ship :) |
beautiful! will benchmark this w/our datasets after deps are updated |
This makes cbor encoding and decoding a lot faster. Fixes #23
This makes cbor encoding and decoding a lot faster. Fixes #23
We're running some large-scale ingestions involving CBOR encoding and we're seeing this kind of performance per 1k objects:
pure js: 1.3s
tinycbor (C/C++): 0.06s
In this case the pure js impl is node-cbor because #22 blocks us from using js-ipld directly, but I would expect similar performance here. This is a huge difference and can potentially make or break the use case for larger datasets. We're exploring a couple of different paths here:
Would love to work w/upstream here to deliver something that works for everyone. wasm certainly seems like a future-looking option that would work isomorphically (in a couple of months, at least 😄 ) so I am interested in exploring this path.
Corresponding issue in mediachain/aleph#27 /cc @yusefnapora
The text was updated successfully, but these errors were encountered: