[darcs-devel] [patch1823] v3: basic implementation and tests

Ben Franksen bugs at darcs.net
Sat Jun 15 08:08:03 UTC 2019


Ben Franksen <ben.franksen at online.de> added the comment:

> Actually, a followup thought is do we really need this slightly
> opaque encoding, or could we use a Bool like PatchInfo has?

We certainly could. But we'd still have to maintain an invariant (>=0).
I tried to minimize the memory footprint here. Note this gets attached
to /every/ single prim patch (if it is part of a RepoPatchV3).

> In the same vein, I wonder a bit about the SHA1. I wonder what
> the trade-offs between that and using the PatchInfo directly are (if
> the latter is even possible). I'll need to get to grips with the rest
> of the code to have a good feeling for that though.

Again, certainly possible. But remember that the PrimPatchId is part of
the on-disk representation. Using the full meta-data would make patches
quite a bit larger, slowing down read and write of patches and also
equality tests. And since we read PrimPatchIds from disk, we cannot (at
least not automatically) share equal PrimPatchIds in memory, so memory
requirements would also go up significantly.

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/patch1823>
__________________________________


More information about the darcs-devel mailing list