use ByteString for git config
The parser and looking up config keys in the map should both be faster due to using ByteString. I had hoped this would speed up startup time, but any improvement to that was too small to measure. Seems worth keeping though. Note that the parser breaks up the ByteString, but a config map ends up pointing to the config as read, which is retained in memory until every value from it is no longer used. This can change memory usage patterns marginally, but won't affect git-annex.
This commit is contained in:
parent
37d0f73e66
commit
d7833def66
27 changed files with 176 additions and 105 deletions
|
@ -11,6 +11,8 @@
|
|||
- Licensed under the GNU AGPL version 3 or higher.
|
||||
-}
|
||||
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
|
||||
module Annex.UUID (
|
||||
getUUID,
|
||||
getRepoUUID,
|
||||
|
@ -112,7 +114,7 @@ storeUUIDIn configfield = setConfig configfield . fromUUID
|
|||
{- Only sets the configkey in the Repo; does not change .git/config -}
|
||||
setUUID :: Git.Repo -> UUID -> IO Git.Repo
|
||||
setUUID r u = do
|
||||
let s = show configkey ++ "=" ++ fromUUID u
|
||||
let s = encodeBS' $ show configkey ++ "=" ++ fromUUID u
|
||||
Git.Config.store s r
|
||||
|
||||
-- Dummy uuid for the whole web. Do not alter.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue