git-annex/Types
Joey Hess 5c960601aa 4 ns optimisation of repeated calls to hasDifference on the same Differences
I want this as fast as possible, so it can be added to code paths without
slowing them down.

Avoid the set lookup, and rely on laziness,
drops runtime from 14.37 ns to 11.03 ns according to this criterion benchmark:

import Criterion.Main
import qualified Types.Difference as New
import qualified Types.DifferenceOld as Old

main :: IO ()
main = defaultMain
	[ bgroup "hasDifference"
		[ bench "new" $ whnf (New.hasDifference New.OneLevelObjectHash) new
		, bench "old" $ whnf (Old.hasDifference Old.OneLevelObjectHash) old
		]
	]
  where
	s = "fromList [ObjectHashLower, OneLevelObjectHash, OneLevelBranchHash]"
	new = New.readDifferences s
	old = Old.readDifferences s

A little bit of added boilerplate, but I suppose it's worth it to not
need to worry about set lookup overhead. Note that adding more differences
would slow down the old implementation; the new implementation will run
the same speed.
2015-06-11 16:34:35 -04:00
..
Availability.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00
Backend.hs update my email address and homepage url 2015-01-21 12:50:09 -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 update my email address and homepage url 2015-01-21 12:50:09 -04:00
Creds.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00
Crypto.hs refactor 2015-04-19 10:57:14 -04:00
DesktopNotify.hs rejigger imports for clean build with ghc 7.10's AMP changes 2015-05-10 16:20:30 -04:00
Difference.hs 4 ns optimisation of repeated calls to hasDifference on the same Differences 2015-06-11 16:34:35 -04:00
Distribution.hs a few hlints 2015-04-11 00:10:34 -04:00
FileMatcher.hs relFile does not have to be relative; rename to currFile 2015-02-06 16:03:02 -04:00
GitConfig.hs better memoize core.sharedrepository handling 2015-05-19 15:04:24 -04:00
Group.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00
Key.hs fromkey, registerurl: Improve handling of urls that happen to also be parsable as strange keys. 2015-05-30 02:08:49 -04:00
KeySource.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00
LockCache.hs use lock pools throughout git-annex 2015-05-19 14:09:52 -04:00
Messages.hs use built-in progress meters for git when in parallel mode 2015-04-10 15:15:21 -04:00
MetaData.hs metadata: Fix encoding problem that led to mojibake when storing metadata strings that contained both unicode characters and a space (or '!') character. 2015-03-04 12:54:30 -04:00
NumCopies.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00
Option.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00
RefSpec.hs unused: Add --used option, which can specify a set of refs to consider used, rather than the default of considering all refs used. 2015-05-14 15:31:38 -04:00
Remote.hs Merge branch 'master' into concurrentprogress 2015-05-12 13:23:22 -04:00
ScheduledActivity.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00
StandardGroups.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00
StoreRetrieve.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00
TrustLevel.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00
UrlContents.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00
UUID.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00
View.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00