- 22 Aug, 2021 1 commit
-
-
tavit ohanian authored
-
- 30 Mar, 2021 1 commit
-
-
Daniel Martí authored
An io.Writer, by definition, will always copy bytes. That's fine in general, and can't be worked around without breaking the writer's contract. However, the main use of go-codec-dagpb today is go-merkledag, which simply uses the codec to encode a node into a buffer. So, we had to create a new bytes.Buffer, write to it, and grab its bytes. This is one extra allocation (the bytes.Buffer object itself), plus copying the encoded bytes an extra time, since we must copy from Encode's internal buffer to the bytes.Buffer. Add a lower-level append-like AppendEncode that cuts the middle man, removing both of those extra pieces of work. For the sake of consistency, we add DecodeBytes to mirror the above on the decode side. Decode already had a shortcut for Bytes, but this way it's more evident what we're doing, and we also avoid allocating a bytes.Buffer just to call Bytes on it. Using these new APIs in go-merkledag shows nice results: name old time/op new time/op delta Roundtrip-8 4.27µs ± 0% 4.07µs ± 0% -4.50% (p=0.004 n=5+6) name old alloc/op new alloc/op delta Roundtrip-8 6.86kB ± 0% 6.38kB ± 0% -6.99% (p=0.002 n=6+6) name old allocs/op new allocs/op delta Roundtrip-8 106 ± 0% 103 ± 0% -2.83% (p=0.002 n=6+6) While at it, we formally deprecate Marshal and Unmarshal, since we're starting to have lots of redundant API surface.
-
- 17 Mar, 2021 1 commit
-
-
Daniel Martí authored
We're a semver v1, so we can't remove exposed APIs unless we bump to v2+. Bumping the major version to just rename two APIs seems a bit overkill; keeping the old ones around and deprecating them is much easier. This partially reverts commit b8473079.
-
- 16 Mar, 2021 1 commit
-
-
Daniel Martí authored
At least go-merkledag and go-graphsync still need a prototype chooser, and go-ipld-prime-proto provides one, so this simplifies integration with downstreams. It's worth noting that we just add PBNode here, while go-ipld-prime-proto also added RawNode. This is because this dag-pb module leaves raw nodes out, since those are now in go-ipld-prime/codec/raw. The logic is just three lines, but it's still easier to not have to copy-paste these between different projects.
-
- 15 Mar, 2021 3 commits
-
-
acruikshank authored
-
Eric Myhre authored
A similar change to Encode and Decode function names came in go-ipld-prime v0.9.0, so this keeps this library in sync. Improved package docs a bit to talk about the new go-ipld-prime LinkSystem, which is a bit clearer to refer to than before. Target-of-opportunity fix some typos in docs.
-
acruikshank authored
-
- 08 Mar, 2021 1 commit
-
-
acruikshank authored
-
- 09 Dec, 2020 1 commit
-
-
Rod Vagg authored
-
- 08 Dec, 2020 1 commit
-
-
Rod Vagg authored
-
- 07 Dec, 2020 1 commit
-
-
Rod Vagg authored
-