git-annex/Types
Joey Hess b552551b33
use ByteString in Key for speed
This is an easy win for parseKeyVariety:

benchmarking old/parseKeyVariety
time                 1.515 μs   (1.512 μs .. 1.517 μs)
                     1.000 R²   (1.000 R² .. 1.000 R²)
mean                 1.515 μs   (1.513 μs .. 1.517 μs)
std dev              6.417 ns   (4.992 ns .. 8.113 ns)

benchmarking new/parseKeyVariety
time                 54.97 ns   (54.70 ns .. 55.40 ns)
                     0.999 R²   (0.999 R² .. 1.000 R²)
mean                 55.42 ns   (55.05 ns .. 56.03 ns)
std dev              1.562 ns   (969.5 ps .. 2.442 ns)
variance introduced by outliers: 44% (moderately inflated)

For formatKeyVariety, using a Builder is marginally worse than building a
String... (This is with criterion evaluating fully to nf not whnf)

benchmarking old/formatKeyVariety
time                 434.3 ns   (428.0 ns .. 440.4 ns)
                     0.999 R²   (0.999 R² .. 1.000 R²)
mean                 430.6 ns   (428.2 ns .. 433.9 ns)
std dev              9.166 ns   (6.932 ns .. 11.94 ns)
variance introduced by outliers: 27% (moderately inflated)

benchmarking Builder/formatKeyVariety
time                 526.5 ns   (524.7 ns .. 528.8 ns)
                     1.000 R²   (1.000 R² .. 1.000 R²)
mean                 526.1 ns   (524.9 ns .. 528.5 ns)
std dev              5.687 ns   (3.762 ns .. 8.000 ns)

Manually building the ByteString was better, but still slightly slower than String,
due to innefficient need to S.pack . show the HashSize:

benchmarking formatKeyVariety
time                 459.5 ns   (455.8 ns .. 463.2 ns)
                     1.000 R²   (0.999 R² .. 1.000 R²)
mean                 459.9 ns   (457.4 ns .. 466.6 ns)
std dev              11.65 ns   (6.860 ns .. 21.41 ns)
variance introduced by outliers: 35% (moderately inflated)

So I cheated and made parseKeyVariety cache the original ByteString,
for formatKeyVariety to use instead of re-building it. Final benchmark:

benchmarking new/formatKeyVariety
time                 50.64 ns   (50.57 ns .. 50.73 ns)
                     1.000 R²   (0.999 R² .. 1.000 R²)
mean                 51.05 ns   (50.60 ns .. 52.71 ns)
std dev              2.790 ns   (259.6 ps .. 5.916 ns)
variance introduced by outliers: 75% (severely inflated)

benchmarking new/parseKeyVariety
time                 71.88 ns   (71.54 ns .. 72.24 ns)
                     1.000 R²   (1.000 R² .. 1.000 R²)
mean                 71.97 ns   (71.69 ns .. 72.47 ns)
std dev              1.249 ns   (910.7 ps .. 1.791 ns)
variance introduced by outliers: 22% (moderately inflated)
2019-01-11 16:32:51 -04:00
..
ActionItem.hs better dup key with -J fix 2017-10-17 18:48:53 -04:00
AdjustedBranch.hs refactor getCurrentBranch 2018-10-19 17:29:18 -04:00
Availability.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00
Backend.hs annex.maxextensionlength 2018-09-24 12:10:18 -04:00
Benchmark.hs new improved benchmark command that can benchmark anything git-annex does 2019-01-04 13:46:36 -04:00
BranchState.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00
CleanupActions.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00
Command.hs Make --json and --quiet suppress automatic init messages 2016-09-05 15:34:38 -04:00
Concurrency.hs disentangle concurrency and message type 2016-09-09 12:57:42 -04:00
Creds.hs Added git-remote-tor-annex, which allows git pull and push to the tor hidden service. 2016-11-21 17:27:38 -04:00
Crypto.hs Added new encryption=sharedpubkey mode for special remotes. 2016-05-10 16:50:31 -04:00
DeferredParse.hs fix build warnings under ghc 7.10 2015-12-19 17:42:45 -04:00
DesktopNotify.hs removed the old Android app 2018-10-13 01:41:11 -04:00
Difference.hs removed the old Android app 2018-10-13 01:41:11 -04:00
Distribution.hs adeiu, MissingH 2017-05-16 01:03:52 -04:00
Export.hs add dropFromEnd 2018-11-23 11:24:05 -04:00
FileMatcher.hs support findred and --branch with file matching options 2018-12-09 13:38:35 -04:00
GitConfig.hs annex.cachecreds: New config to allow disabling of credentials caching for special remotes. 2018-12-04 14:16:56 -04:00
Group.hs convert old uuid-based log parsers to attoparsec 2019-01-10 16:34:20 -04:00
Key.hs use ByteString in Key for speed 2019-01-11 16:32:51 -04:00
KeySource.hs refactoring 2015-12-22 13:42:58 -04:00
LockCache.hs convert from Utility.LockPool to Annex.LockPool everywhere 2015-11-12 18:13:37 -04:00
Messages.hs removed the old Android app 2018-10-13 01:41:11 -04:00
MetaData.hs switch MetaValue to ByteString and MetaField to Text 2019-01-07 14:18:24 -04:00
NumCopies.hs Get rid of unnecessary Monad constraint 2016-01-28 12:34:07 -04:00
RefSpec.hs Some optimisations to string splitting code. 2017-01-31 19:06:22 -04:00
Remote.hs export appendonly support 2018-08-30 11:18:20 -04:00
RepoVersion.hs v7 2018-10-25 18:24:23 -04:00
ScheduledActivity.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00
StandardGroups.hs newtype Group to ByteString 2019-01-09 15:05:49 -04:00
StoreRetrieve.hs remove 163 lines of code without changing anything except imports 2016-01-20 16:36:33 -04:00
Test.hs removed the old Android app 2018-10-13 01:41:11 -04:00
Transfer.hs reorg 2017-12-14 11:26:59 -04:00
TrustLevel.hs finish fixing inverted Ord for TrustLevel 2018-04-13 15:17:54 -04:00
UrlContents.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00
UUID.hs add missing case 2019-01-10 17:17:37 -04:00
View.hs remove 163 lines of code without changing anything except imports 2016-01-20 16:36:33 -04:00