-
Notifications
You must be signed in to change notification settings - Fork 22
Make js-libp2p-secio faster so that js-ipfs is faster 🚀 #96
Comments
@diasdavid in your experience is this more of an issue in node.js or browser land, or similar? |
Perhaps you'd like to capture some flamegraphs? If so, you could try running it through 0x. |
I did some benchmarks master (my machine):
async/await & async iterators (my machine): 🥁 drumroll
|
Seems like this problem should magically go away once we use async iterators |
Readable Streams have been indeed historically slow. @mkg20001 make sure to run tests all the way to ipfs/interop to not miss anything |
...from 4/sec to 6,000/sec? No way...I don't believe it. |
There could be some trouble with the way benchmark.js handles async testing, as it will often launch stuff in parallel. Maybe v8 applies too much magic and skews the results. Maybe async overload also skews some timeouts. Or... maybe it's really that fast We'll see once it's in master. But faster it is, that's for sure! 🎉 |
@mkg20001 have you npm link'ed this new version into js-ipfs to run its tests and also run the ipfs/interop tests? |
That won't be able to happen until we start getting libp2p integrated into js-ipfs. The async changes will need to be incorporated before we can do the full interop tests, as the interfaces have changed. |
That's scary. Is there a way that js-libp2p is testing itself against the other implementations that we can safely rely on (e.g. that would replace the need to run the interop tests)? |
We have interop tests for js and go libp2p that we will be running earlier, https://github.com/libp2p/interop. We'll mitigate any risk and test things thoroughly before we go live, including running the full gambit of tests for ipfs. |
I've expanded secio's benchmarks -- https://github.com/libp2p/js-libp2p-secio/blob/master/benchmarks/send.js --. The results (on my machine) are:
secio is currently one of the areas that consume most memory and time during the execution of a js-ipfs node. Getting a performance boost in this module (or libp2p-crypto) will bring a significant boost to js-ipfs as well.
The text was updated successfully, but these errors were encountered: