git-annex/Remote
Joey Hess 81d402216d cache the serialization of a Key
This will speed up the common case where a Key is deserialized from
disk, but is then serialized to build eg, the path to the annex object.

Previously attempted in 4536c93bb2
and reverted in 96aba8eff7.
The problems mentioned in the latter commit are addressed now:

Read/Show of KeyData is backwards-compatible with Read/Show of Key from before
this change, so Types.Distribution will keep working.

The Eq instance is fixed.

Also, Key has smart constructors, avoiding needing to remember to update
the cached serialization.

Used git-annex benchmark:
  find is 7% faster
  whereis is 3% faster
  get when all files are already present is 5% faster
Generally, the benchmarks are running 0.1 seconds faster per 2000 files,
on a ram disk in my laptop.
2019-11-22 17:49:16 -04:00
..
Directory update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
External cache the serialization of a Key 2019-11-22 17:49:16 -04:00
Helper cache the serialization of a Key 2019-11-22 17:49:16 -04:00
Rsync avoid rsync/gcrypt ssh startup delay with -J 2019-06-13 11:16:38 -04:00
WebDAV update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Adb.hs add RemoteStateHandle 2019-10-14 13:51:42 -04:00
BitTorrent.hs cache the serialization of a Key 2019-11-22 17:49:16 -04:00
Bup.hs add RemoteStateHandle 2019-10-14 13:51:42 -04:00
Ddar.hs add RemoteStateHandle 2019-10-14 13:51:42 -04:00
Directory.hs add RemoteStateHandle 2019-10-14 13:51:42 -04:00
External.hs cache the serialization of a Key 2019-11-22 17:49:16 -04:00
GCrypt.hs remove some unncessary uses of warningIO 2019-11-12 10:07:27 -04:00
Git.hs cache the serialization of a Key 2019-11-22 17:49:16 -04:00
GitLFS.hs cache the serialization of a Key 2019-11-22 17:49:16 -04:00
Glacier.hs cache the serialization of a Key 2019-11-22 17:49:16 -04:00
Hook.hs add RemoteStateHandle 2019-10-14 13:51:42 -04:00
List.hs sync, assistant: Pull and push from git-lfs remotes. 2019-11-18 16:13:21 -04:00
P2P.hs add RemoteStateHandle 2019-10-14 13:51:42 -04:00
Rsync.hs add RemoteStateHandle 2019-10-14 13:51:42 -04:00
S3.hs cache the serialization of a Key 2019-11-22 17:49:16 -04:00
Tahoe.hs add RemoteStateHandle 2019-10-14 13:51:42 -04:00
Web.hs cache the serialization of a Key 2019-11-22 17:49:16 -04:00
WebDAV.hs add RemoteStateHandle 2019-10-14 13:51:42 -04:00