git-annex/git-annex.cabal
Joey Hess 7390f08ef9 Use cryptohash rather than SHA for hashing.
This is a massive win on OSX, which doesn't have a sha256sum normally.

Only use external hash commands when the file is > 1 mb,
since cryptohash is quite close to them in speed.

SHA is still used to calculate HMACs. I don't quite understand
cryptohash's API for those.

Used the following benchmark to arrive at the 1 mb number.

1 mb file:

benchmarking sha256/internal
mean: 13.86696 ms, lb 13.83010 ms, ub 13.93453 ms, ci 0.950
std dev: 249.3235 us, lb 162.0448 us, ub 458.1744 us, ci 0.950
found 5 outliers among 100 samples (5.0%)
  4 (4.0%) high mild
  1 (1.0%) high severe
variance introduced by outliers: 10.415%
variance is moderately inflated by outliers

benchmarking sha256/external
mean: 14.20670 ms, lb 14.17237 ms, ub 14.27004 ms, ci 0.950
std dev: 230.5448 us, lb 150.7310 us, ub 427.6068 us, ci 0.950
found 3 outliers among 100 samples (3.0%)
  2 (2.0%) high mild
  1 (1.0%) high severe

2 mb file:

benchmarking sha256/internal
mean: 26.44270 ms, lb 26.23701 ms, ub 26.63414 ms, ci 0.950
std dev: 1.012303 ms, lb 925.8921 us, ub 1.122267 ms, ci 0.950
variance introduced by outliers: 35.540%
variance is moderately inflated by outliers

benchmarking sha256/external
mean: 26.84521 ms, lb 26.77644 ms, ub 26.91433 ms, ci 0.950
std dev: 347.7867 us, lb 210.6283 us, ub 571.3351 us, ci 0.950
found 6 outliers among 100 samples (6.0%)

import Crypto.Hash
import Data.ByteString.Lazy as L
import Criterion.Main
import Common

testfile :: FilePath
testfile = "/run/shm/data" -- on ram disk

main = defaultMain
        [ bgroup "sha256"
                [ bench "internal" $ whnfIO internal
                , bench "external" $ whnfIO external
                ]
        ]

sha256 :: L.ByteString -> Digest SHA256
sha256 = hashlazy

internal :: IO String
internal = show . sha256 <$> L.readFile testfile

external :: IO String
external = do
	s <- readProcess "sha256sum" [testfile]
        return $ fst $ separate (== ' ') s
2013-09-22 20:06:02 -04:00

173 lines
4.7 KiB
Text

Name: git-annex
Version: 4.20130920
Cabal-Version: >= 1.8
License: GPL-3
Maintainer: Joey Hess <joey@kitenet.net>
Author: Joey Hess
Stability: Stable
Copyright: 2010-2013 Joey Hess
License-File: COPYRIGHT
Homepage: http://git-annex.branchable.com/
Build-type: Custom
Category: Utility
Synopsis: manage files with git, without checking their contents into git
Description:
git-annex allows managing files with git, without checking the file
contents into git. While that may seem paradoxical, it is useful when
dealing with files larger than git can currently easily handle, whether due
to limitations in memory, time, or disk space.
.
Even without file content tracking, being able to manage files with git,
move files around and delete files with versioned directory trees, and use
branches and distributed clones, are all very handy reasons to use git. And
annexed files can co-exist in the same git repository with regularly
versioned files, which is convenient for maintaining documents, Makefiles,
etc that are associated with annexed files but that benefit from full
revision control.
Flag S3
Description: Enable S3 support
Flag WebDAV
Description: Enable WebDAV support
Flag Inotify
Description: Enable inotify support
Flag Dbus
Description: Enable dbus support
Flag Assistant
Description: Enable git-annex assistant and watch command
Flag Webapp
Description: Enable git-annex webapp
Flag Pairing
Description: Enable pairing
Flag XMPP
Description: Enable notifications using XMPP
Flag DNS
Description: Enable the haskell DNS library for DNS lookup
Flag Production
Description: Enable production build (slower build; faster binary)
Flag Android
Description: Building for Android
Default: False
Flag TestSuite
Description: Embed the test suite into git-annex
Flag TDFA
Description: Use regex-tdfa for wildcards
Flag Feed
Description: Enable podcast feed support
Flag Quvi
Description: Enable use of quvi to download videos
Executable git-annex
Main-Is: git-annex.hs
Build-Depends: MissingH, hslogger, directory, filepath,
containers, utf8-string, network (>= 2.0), mtl (>= 2),
bytestring, old-locale, time, HTTP,
extensible-exceptions, dataenc, SHA, cryptohash, process, json,
base (>= 4.5 && < 4.8), monad-control, MonadCatchIO-transformers,
IfElse, text, QuickCheck >= 2.1, bloomfilter, edit-distance, process,
SafeSemaphore, uuid, random, dlist, unix-compat
-- Need to list these because they're generated from .hsc files.
Other-Modules: Utility.Touch Utility.Mounts
Include-Dirs: Utility
C-Sources: Utility/libdiskfree.c Utility/libmounts.c
CC-Options: -Wall
GHC-Options: -Wall
CPP-Options: -DWITH_CLIBS
Extensions: PackageImports
-- Some things don't work with the non-threaded RTS.
GHC-Options: -threaded
if flag(Production)
GHC-Options: -O2
if os(windows)
CPP-Options: -D__WINDOWS__
else
Build-Depends: unix
if flag(TestSuite)
Build-Depends: HUnit
CPP-Options: -DWITH_TESTSUITE
if flag(TDFA)
Build-Depends: regex-tdfa
CPP-Options: -DWITH_TDFA
if flag(S3)
Build-Depends: hS3
CPP-Options: -DWITH_S3
if flag(WebDAV)
Build-Depends: DAV (>= 0.3), http-conduit, xml-conduit, http-types
CPP-Options: -DWITH_WEBDAV
if flag(Assistant) && ! os(windows) && ! os(solaris)
Build-Depends: async, stm (>= 2.3)
CPP-Options: -DWITH_ASSISTANT
if flag(Android)
Build-Depends: data-endian
CPP-Options: -D__ANDROID__
if flag(Assistant)
if os(linux) && flag(Inotify)
Build-Depends: hinotify
CPP-Options: -DWITH_INOTIFY
else
if os(darwin)
Build-Depends: hfsevents
CPP-Options: -DWITH_FSEVENTS
else
if (! os(windows) && ! os(solaris) && ! os(linux))
CPP-Options: -DWITH_KQUEUE
C-Sources: Utility/libkqueue.c
if os(linux) && flag(Dbus)
Build-Depends: dbus (>= 0.10.3)
CPP-Options: -DWITH_DBUS
if flag(Webapp)
Build-Depends:
yesod, yesod-default, yesod-static, yesod-form, yesod-core,
case-insensitive, http-types, transformers, wai, wai-logger, warp,
blaze-builder, crypto-api, hamlet, clientsession,
template-haskell, data-default, aeson
CPP-Options: -DWITH_WEBAPP
if flag(Pairing)
Build-Depends: network-multicast, network-info
CPP-Options: -DWITH_PAIRING
if flag(XMPP)
Build-Depends: network-protocol-xmpp, gnutls (>= 0.1.4), xml-types
CPP-Options: -DWITH_XMPP
if flag(DNS)
Build-Depends: dns
CPP-Options: -DWITH_DNS
if flag(Feed)
Build-Depends: feed
CPP-Options: -DWITH_FEED
if flag(Quvi)
Build-Depends: aeson
CPP-Options: -DWITH_QUVI
source-repository head
type: git
location: git://git-annex.branchable.com/