git-annex/Utility
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 explict export lists 2019-11-21 16:08:37 -04:00
DirWatcher explict export lists 2019-11-21 16:08:37 -04:00
Env explict export lists 2019-11-21 16:08:37 -04:00
LockFile explict export lists 2019-11-21 16:08:37 -04:00
LockPool add DebugLocks build flag 2018-11-19 15:02:43 -04:00
Path explict export lists 2019-11-21 16:08:37 -04:00
Process explict export lists 2019-11-21 16:08:37 -04:00
Scheduled reorg quickcheck to a separate module 2015-11-17 15:49:22 -04:00
Tmp avoid conflicting definitions of Template type 2018-12-30 15:03:31 -04:00
Aeson.hs switch MetaValue to ByteString and MetaField to Text 2019-01-07 14:18:24 -04:00
Android.hs explict export lists 2019-11-21 16:08:37 -04:00
Applicative.hs squelch tab warnings 2019-11-22 12:49:41 -04:00
AuthToken.hs comment typo 2019-01-03 00:22:05 -04:00
Base64.hs switch MetaValue to ByteString and MetaField to Text 2019-01-07 14:18:24 -04:00
Batch.hs explict export lists 2019-11-21 16:08:37 -04:00
Bloom.hs remove many old version ifdefs 2019-07-05 15:09:37 -04:00
CoProcess.hs Always use filesystem encoding for all file and handle reads and writes. 2016-12-24 14:46:31 -04:00
CopyFile.hs improve comment 2019-09-01 12:33:19 -04:00
Daemon.hs explict export lists 2019-11-21 16:08:37 -04:00
Data.hs explict export lists 2019-11-21 16:08:37 -04:00
DataUnits.hs adeiu, MissingH 2017-05-16 01:03:52 -04:00
DBus.hs explict export lists 2019-11-21 16:08:37 -04:00
DebugLocks.hs explict export lists 2019-11-21 16:08:37 -04:00
Directory.hs finally really add back custom-setup stanza 2017-12-31 16:36:39 -04:00
DirWatcher.hs explict export lists 2019-11-21 16:08:37 -04:00
DiskFree.hs removed the old Android app 2018-10-13 01:41:11 -04:00
Dot.hs explict export lists 2019-11-21 16:08:37 -04:00
DottedVersion.hs explict export lists 2019-11-21 16:08:37 -04:00
Env.hs explict export lists 2019-11-21 16:08:37 -04:00
Exception.hs removed the old Android app 2018-10-13 01:41:11 -04:00
FileMode.hs Make test suite work better when the temp directory is on NFS. 2018-12-19 12:44:56 -04:00
FileSize.hs squelch tab warnings 2019-11-22 12:49:41 -04:00
FileSystemEncoding.hs slight optimisation more 2019-01-11 19:56:31 -04:00
Format.hs fix failing quickcheck properties 2017-06-17 16:48:00 -04:00
FreeDesktop.hs use System.Directory not Utility.Directory 2016-09-22 11:34:55 -04:00
GitLFS.hs remove unused 2019-09-24 18:16:01 -04:00
Glob.hs adeiu, MissingH 2017-05-16 01:03:52 -04:00
Gpg.hs explict export lists 2019-11-21 16:08:37 -04:00
Hash.hs cache the serialization of a Key 2019-11-22 17:49:16 -04:00
HtmlDetect.hs explict export lists 2019-11-21 16:08:37 -04:00
HttpManagerRestricted.hs merge from http-client-restricted 2019-07-17 16:48:50 -04:00
HumanNumber.hs explict export lists 2019-11-21 16:08:37 -04:00
HumanTime.hs Estimated time to completion display shortened from eg "1h1m1s" to "1h1m" 2019-01-21 00:04:35 -04:00
InodeCache.hs Windows: Fix handling of changes to time zone. 2019-11-21 17:28:18 -04:00
IPAddress.hs explict export lists 2019-11-21 16:08:37 -04:00
libkqueue.c update my email address and homepage url 2015-01-21 12:50:09 -04:00
libkqueue.h fix prototype 2012-06-19 01:57:19 -04:00
LinuxMkLibs.hs missed an export 2019-11-22 12:35:57 -04:00
LockFile.hs use lock pools throughout git-annex 2015-05-19 14:09:52 -04:00
LockPool.hs Fix shared lock file FD leak. 2016-03-01 15:31:39 -04:00
LogFile.hs explict export lists 2019-11-21 16:08:37 -04:00
Lsof.hs explict export lists 2019-11-21 16:08:37 -04:00
MagicWormhole.hs fix p2p --pair 2018-07-04 15:14:03 -04:00
Matcher.hs avoid list lookup by parseToken 2019-05-14 13:11:29 -04:00
MD5.hs Corrected some license statements 2019-07-28 14:27:33 -04:00
Metered.hs explict export lists 2019-11-21 16:08:37 -04:00
Misc.hs explict export lists 2019-11-21 16:08:37 -04:00
Monad.hs explict export lists 2019-11-21 16:08:37 -04:00
Mounts.hs removed the old Android app 2018-10-13 01:41:11 -04:00
Network.hs explict export lists 2019-11-21 16:08:37 -04:00
NotificationBroadcaster.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00
OptParse.hs explict export lists 2019-11-21 16:08:37 -04:00
OSX.hs explict export lists 2019-11-21 16:08:37 -04:00
Parallel.hs explict export lists 2019-11-21 16:08:37 -04:00
PartialPrelude.hs explict export lists 2019-11-21 16:08:37 -04:00
Path.hs explict export lists 2019-11-21 16:08:37 -04:00
Percentage.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00
PID.hs explict export lists 2019-11-21 16:08:37 -04:00
Process.hs fix bogus ghc 8.6.3 build warning 2018-12-30 14:43:27 -04:00
QuickCheck.hs remove many old version ifdefs 2019-07-05 15:09:37 -04:00
RawFilePath.hs use ByteStrings when reading annex symlinks and pointers 2019-01-14 15:37:08 -04:00
Rsync.hs explict export lists 2019-11-21 16:08:37 -04:00
SafeCommand.hs Revert "fix comment" 2018-11-06 17:26:20 -04:00
Scheduled.hs add dropFromEnd 2018-11-23 11:24:05 -04:00
Shell.hs removed the old Android app 2018-10-13 01:41:11 -04:00
SimpleProtocol.hs clean P2P protocol shutdown on EOF 2018-09-13 10:46:37 -04:00
Split.hs add dropFromEnd 2018-11-23 11:24:05 -04:00
SshConfig.hs redundant import 2015-09-22 12:31:54 -04:00
SshHost.hs avoid the dashed ssh hostname class of security holes 2017-08-17 22:11:31 -04:00
Su.hs explict export lists 2019-11-21 16:08:37 -04:00
SystemDirectory.hs Fix build with directory-1.3. 2016-12-20 15:23:59 -04:00
Tense.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00
ThreadLock.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00
ThreadScheduler.hs removed the old Android app 2018-10-13 01:41:11 -04:00
TimeStamp.hs remove many old version ifdefs 2019-07-05 15:09:37 -04:00
TList.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00
Tmp.hs use relatedTempate in viaTmp 2019-03-04 14:12:00 -04:00
Tor.hs Support building with socks-0.6 and persistant-template-2.7 2019-07-30 12:50:48 -04:00
Touch.hs remove unused import 2018-10-30 13:38:29 -04:00
Tuple.hs adeiu, MissingH 2017-05-16 01:03:52 -04:00
Url.hs explict export lists 2019-11-21 16:08:37 -04:00
UserInfo.hs removed the old Android app 2018-10-13 01:41:11 -04:00
Verifiable.hs Removed dependency on haskell SHA library, instead using cryptohash >= 0.11.0. 2015-04-19 11:05:32 -04:00
WebApp.hs removed the old Android app 2018-10-13 01:41:11 -04:00
Yesod.hs remove many old version ifdefs 2019-07-05 15:09:37 -04:00