rust-ipfs icon indicating copy to clipboard operation
rust-ipfs copied to clipboard

ipfs-unixfs: no_std and alloc -ification for wasm use

Open koivunej opened this issue 5 years ago • 4 comments

Creating this issue following interest expressed in the comments of #222. I don't have much to go on from my previous comment on this topic.

koivunej avatar Jul 16 '20 12:07 koivunej

I am finally getting a start on this, and my entry into this got a minor error trying to cargo build an example (#266) . Based on your last comment, I may be going down the wrong path?

nuke-web3 avatar Jul 27 '20 22:07 nuke-web3

Would the use of bytes in ipfs-unixfs hurt this goal, or is it no_std compat or could we somehow be generic over the buffer type? It would of course be nice to seek out less allocation or less copying solutions as well.

koivunej avatar Aug 27 '20 06:08 koivunej

As far as I can tell, bytes is no_std-aware and uses core and alloc internally. Enabling (default) std utilizes IoSlice.

ljedrz avatar Aug 27 '20 06:08 ljedrz

Well, that's just excellent. Yeah, need to do some bytes exploration, that might allow a path to much simpler impl and better perf. I'll try to write the thoughts up... Later.

koivunej avatar Aug 27 '20 11:08 koivunej