- 16 Jul, 2021 1 commit
-
-
Rod Vagg authored
-
- 25 Feb, 2021 1 commit
-
-
Eric Myhre authored
This significantly reworks how linking is handled. All of the significant operations involved in storing and loading data are extracted into their own separate features, and the LinkSystem just composes them. The big advantage of this is we can now add as many helper methods to the LinkSystem construct as we want -- whereas previously, adding methods to the Link interface was a difficult thing to do, because that interface shows up in a lot of places. Link is now *just* treated as a data holder -- it doesn't need logic attached to it directly. This is much cleaner. The way we interact with the CID libraries is also different. We're doing multihash registries ourselves, and breaking our direct use of the go-multihash library. The big upside is we're now using the familiar and standard hash.Hash interface from the golang stdlib. (And as a bonus, that actually works streamingly; go-mulithash didn't.) However, this also implies a really big change for downstream users: we're no longer baking as many hashes into the new multihash registry by default.
-
- 18 Jan, 2021 1 commit
-
-
Daniel Martí authored
This is what I came up with, building on top of Eric's quip. I don't want to waste too much time naming this, and I like two-letter package names in place of dot-imports, so "qp" seems good enough for now. They are the "strong" consonants when one says "Quick iPld". First, move the benchmarks comparing all fluent packages to the root fluent package, to keep things a bit more tidy. Second, make all the benchmarks report their allocation stats, without having to always remember to use the -benchmem flag. Third, add a qp benchmark. Fourth, notice a couple of potential bugs in the quip benchmarks, and add TODOs for them. Finally, add the qp API. It differs from quip in a few external ways: 1) No error pointers. Instead, it uses panics which are recovered at the top-level API layer. This reduces verbosity, removes the "forgot to handle an error" type of mistake, and does not affect performance thanks to the defers being statically allocated in the stack. 2) Supposed better composition. For example, one can use MapEntry along with Map to have a map inside another map. In contrast, quip requires either an extra layer of func literals, or extra API like AssignMapEntryString. 3) Thanks to the points above, the API is significantly smaller. Note that some helper APIs like Bool are missing, but even when added, qp should expose about half the API funcs taht quip does. This is the first proof of concept. I'll probably finish adding the rest of the API helpers when I find the first use case for qp. Benchmark numbers, with perflock and benchstat on my i5-8350u laptop: name time/op Quip-8 1.39µs ± 1% QuipWithoutScalarFuncs-8 1.42µs ± 2% Qp-8 1.46µs ± 2% name alloc/op Quip-8 912B ± 0% QuipWithoutScalarFuncs-8 912B ± 0% Qp-8 912B ± 0% name allocs/op Quip-8 18.0 ± 0% QuipWithoutScalarFuncs-8 18.0 ± 0% Qp-8 18.0 ± 0%
-