Skip to content
This repository has been archived by the owner on Apr 29, 2020. It is now read-only.

feat: use a rabin chunker in wasm #31

Merged
merged 2 commits into from
Jun 4, 2019
Merged

Conversation

hugomrdias
Copy link
Contributor

@hugomrdias hugomrdias commented May 31, 2019

This PR adds a WASM rabin chunker that works in node and js.
If merged this will be the first wasm module in js-ipfs code base Yay 🚀

some benchmarks on a 100Mb random stream

native rabin x 0.51 ops/sec ±2.56% (7 runs sampled)
wasm rabin x 0.23 ops/sec ±2.72% (6 runs sampled)
js rabin x 0.05 ops/sec ±3.78% (5 runs sampled)
Fastest is native rabin

This makes the wasm version consistently 50% slower (it will only get faster) than native but works in the browser, node 10 and 12 and has no native dependencies.

Regarding size
Package size: 4.66 KB with all dependencies, minified and gzipped

/cc @ipfs/wg-js-core

Copy link
Collaborator

@achingbrain achingbrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, LGTM

@achingbrain achingbrain merged commit d4021db into master Jun 4, 2019
@achingbrain achingbrain deleted the feat/rabin-chunker-wasm branch June 4, 2019 12:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants