wip RawFilePath
Goal is to make git-annex faster by using ByteString for all the worktree traversal. For now, this is focusing on Command.Find, in order to benchmark how much it helps. (All other commands are temporarily disabled) Currently in a very bad unbuildable in-between state.
This commit is contained in:
parent
1f035c0d66
commit
6a97ff6b3a
25 changed files with 258 additions and 200 deletions
|
@ -12,6 +12,7 @@ module Utility.Misc (
|
|||
readFileStrict,
|
||||
separate,
|
||||
firstLine,
|
||||
firstLine',
|
||||
segment,
|
||||
segmentDelim,
|
||||
massReplace,
|
||||
|
@ -28,6 +29,7 @@ import Data.Char
|
|||
import Data.List
|
||||
import System.Exit
|
||||
import Control.Applicative
|
||||
import qualified Data.ByteString as S
|
||||
import Prelude
|
||||
|
||||
{- A version of hgetContents that is not lazy. Ensures file is
|
||||
|
@ -56,6 +58,11 @@ separate c l = unbreak $ break c l
|
|||
firstLine :: String -> String
|
||||
firstLine = takeWhile (/= '\n')
|
||||
|
||||
firstLine' :: S.ByteString -> S.ByteString
|
||||
firstLine' = S.takeWhile (/= nl)
|
||||
where
|
||||
nl = fromIntegral (ord '\n')
|
||||
|
||||
{- Splits a list into segments that are delimited by items matching
|
||||
- a predicate. (The delimiters are not included in the segments.)
|
||||
- Segments may be empty. -}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue