git-annex/Command
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
..
Add.hs v7 for all repositories 2019-08-30 14:09:14 -04:00
AddUnused.hs remove most remnants of direct mode 2019-08-26 16:27:48 -04:00
AddUrl.hs cache the serialization of a Key 2019-11-22 17:49:16 -04:00
Adjust.hs adjust --lock: This enters an adjusted branch where files are locked. 2019-09-27 14:23:25 -04:00
Assistant.hs remotedaemon: Don't list --stop in help since it's not supported. 2019-09-30 14:40:46 -04:00
Benchmark.hs improve benchmark --databases 2019-11-21 17:25:20 -04:00
CalcKey.hs plumb MeterUpdate into getKey 2019-06-25 11:43:24 -04:00
CheckPresentKey.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Commit.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Config.hs finish CommandStart transition 2019-06-12 13:24:01 -04:00
ConfigList.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
ContentLocation.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Copy.hs make WorkerStage an open type 2019-06-19 13:05:03 -04:00
Dead.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Describe.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
DiffDriver.hs remove direct mode support from Annex.Content 2019-08-27 13:14:06 -04:00
Direct.hs Automatically convert direct mode repositories to v7 with adjusted unlocked branches 2019-08-26 15:05:25 -04:00
Drop.hs remove obsolete comment 2019-10-21 13:51:38 -04:00
DropKey.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
DropUnused.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
EnableRemote.hs autoenable sameas remotes 2019-10-11 15:52:40 -04:00
EnableTor.hs remove recently added and unncessary cwd parameter 2019-10-21 13:48:52 -04:00
ExamineKey.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Expire.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Export.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Find.hs cache the serialization of a Key 2019-11-22 17:49:16 -04:00
FindRef.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Fix.hs v7 for all repositories 2019-08-30 14:09:14 -04:00
Forget.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
FromKey.hs cache the serialization of a Key 2019-11-22 17:49:16 -04:00
Fsck.hs cache the serialization of a Key 2019-11-22 17:49:16 -04:00
FuzzTest.hs remove most remnants of direct mode 2019-08-26 16:27:48 -04:00
GCryptSetup.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Get.hs use fine-grained WorkerStages when transferring and verifying 2019-06-19 13:24:20 -04:00
Group.hs finish CommandStart transition 2019-06-12 13:24:01 -04:00
GroupWanted.hs finish CommandStart transition 2019-06-12 13:24:01 -04:00
Help.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Import.hs encourage use of import from directory special remote rather than legacy interface 2019-11-19 13:30:27 -04:00
ImportFeed.hs make --json-error-messages capture url download errors 2019-11-12 13:52:38 -04:00
InAnnex.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Indirect.hs Automatically convert direct mode repositories to v7 with adjusted unlocked branches 2019-08-26 15:05:25 -04:00
Info.hs cache the serialization of a Key 2019-11-22 17:49:16 -04:00
Init.hs have init --version fail when repo is already initialized with other version 2019-08-08 14:13:02 -04:00
InitRemote.hs autoenable sameas remotes 2019-10-11 15:52:40 -04:00
Inprogress.hs finish CommandStart transition 2019-06-12 13:24:01 -04:00
List.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Lock.hs v7 for all repositories 2019-08-30 14:09:14 -04:00
LockContent.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Log.hs remove many old version ifdefs 2019-07-05 15:09:37 -04:00
LookupKey.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Map.hs add startingNoMessage 2019-06-12 14:11:23 -04:00
MatchExpression.hs cache the serialization of a Key 2019-11-22 17:49:16 -04:00
Merge.hs typo 2019-08-13 13:36:52 -04:00
MetaData.hs finish CommandStart transition 2019-06-12 13:24:01 -04:00
Migrate.hs cache the serialization of a Key 2019-11-22 17:49:16 -04:00
Mirror.hs use fine-grained WorkerStages when transferring and verifying 2019-06-19 13:24:20 -04:00
Move.hs use fine-grained WorkerStages when transferring and verifying 2019-06-19 13:24:20 -04:00
Multicast.hs remove direct mode support from Annex.Content 2019-08-27 13:14:06 -04:00
NotifyChanges.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
NumCopies.hs finish CommandStart transition 2019-06-12 13:24:01 -04:00
P2P.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
P2PStdIO.hs finish CommandStart transition 2019-06-12 13:24:01 -04:00
PostReceive.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
PreCommit.hs v7 for all repositories 2019-08-30 14:09:14 -04:00
Proxy.hs Automatically convert direct mode repositories to v7 with adjusted unlocked branches 2019-08-26 15:05:25 -04:00
ReadPresentKey.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
RecvKey.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
RegisterUrl.hs cache the serialization of a Key 2019-11-22 17:49:16 -04:00
Reinit.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Reinject.hs plumb MeterUpdate into getKey 2019-06-25 11:43:24 -04:00
ReKey.hs remove most remnants of direct mode 2019-08-26 16:27:48 -04:00
RemoteDaemon.hs remotedaemon: Don't list --stop in help since it's not supported. 2019-09-30 14:40:46 -04:00
RenameRemote.hs autoenable sameas remotes 2019-10-11 15:52:40 -04:00
Repair.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Required.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
ResolveMerge.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
RmUrl.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Schedule.hs finish CommandStart transition 2019-06-12 13:24:01 -04:00
Semitrust.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
SendKey.hs cache the serialization of a Key 2019-11-22 17:49:16 -04:00
SetKey.hs cache the serialization of a Key 2019-11-22 17:49:16 -04:00
SetPresentKey.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Smudge.hs cache the serialization of a Key 2019-11-22 17:49:16 -04:00
Status.hs remove most remnants of direct mode 2019-08-26 16:27:48 -04:00
Sync.hs post-receive hook updateInstead emulation cleanup 2019-09-11 14:41:51 -04:00
Test.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
TestRemote.hs cache the serialization of a Key 2019-11-22 17:49:16 -04:00
TransferInfo.hs cache the serialization of a Key 2019-11-22 17:49:16 -04:00
TransferKey.hs finish CommandStart transition 2019-06-12 13:24:01 -04:00
TransferKeys.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Trust.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Unannex.hs v7 for all repositories 2019-08-30 14:09:14 -04:00
Undo.hs fix a couple warnings 2019-08-27 12:24:31 -04:00
Ungroup.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Uninit.hs remove direct mode support from Annex.Content 2019-08-27 13:14:06 -04:00
Unlock.hs v7 for all repositories 2019-08-30 14:09:14 -04:00
Untrust.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Unused.hs remove direct mode support from Annex.Content 2019-08-27 13:14:06 -04:00
Upgrade.hs Added annex.autoupgraderepository configuration 2019-09-01 13:42:26 -04:00
VAdd.hs remove most remnants of direct mode 2019-08-26 16:27:48 -04:00
VCycle.hs remove most remnants of direct mode 2019-08-26 16:27:48 -04:00
Version.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
VFilter.hs remove most remnants of direct mode 2019-08-26 16:27:48 -04:00
Vicfg.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
View.hs remove most remnants of direct mode 2019-08-26 16:27:48 -04:00
VPop.hs remove most remnants of direct mode 2019-08-26 16:27:48 -04:00
Wanted.hs finish CommandStart transition 2019-06-12 13:24:01 -04:00
Watch.hs remotedaemon: Don't list --stop in help since it's not supported. 2019-09-30 14:40:46 -04:00
WebApp.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Whereis.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00