better HTTP connection reuse
Enable HTTP connection reuse across multiple files, when git-annex uses http-conduit. Before, a new Manager was created each time Utility.Url used it. Now, a single Manager gets created the first time, so connections are reused. Doesn't help when external programs are used for url download, but does speed up addurl --fast, fsck --from web, etc. Testing fsck --fast --from web with 3 files, over high-latency satellite internet, it sped up from 19.37s to 14.96s. This commit was supported by the NSF-funded DataLad project.
This commit is contained in:
parent
2ec07bc29f
commit
9b98d3f630
12 changed files with 61 additions and 53 deletions
|
@ -95,7 +95,7 @@ newAssistantUrl repo = do
|
|||
- warp-tls listens to http, in order to show an error page, so this works.
|
||||
-}
|
||||
assistantListening :: URLString -> IO Bool
|
||||
assistantListening url = catchBoolIO $ exists url' def
|
||||
assistantListening url = catchBoolIO $ exists url' =<< defUrlOptions
|
||||
where
|
||||
url' = case parseURI url of
|
||||
Nothing -> url
|
||||
|
|
|
@ -316,7 +316,8 @@ usingDistribution :: IO Bool
|
|||
usingDistribution = isJust <$> getEnv "GIT_ANNEX_STANDLONE_ENV"
|
||||
|
||||
downloadDistributionInfo :: Assistant (Maybe GitAnnexDistribution)
|
||||
downloadDistributionInfo = Url.withUrlOptions $ \uo -> do
|
||||
downloadDistributionInfo = do
|
||||
uo <- liftAnnex Url.getUrlOptions
|
||||
gpgcmd <- liftAnnex $ gpgCmd <$> Annex.getGitConfig
|
||||
liftIO $ withTmpDir "git-annex.tmp" $ \tmpdir -> do
|
||||
let infof = tmpdir </> "info"
|
||||
|
|
|
@ -189,7 +189,8 @@ escapeHeader :: String -> String
|
|||
escapeHeader = escapeURIString (\c -> isUnescapedInURI c && c /= ' ')
|
||||
|
||||
getRepoInfo :: RemoteConfig -> Widget
|
||||
getRepoInfo c = Url.withUrlOptions $ \uo ->
|
||||
getRepoInfo c = do
|
||||
uo <- liftAnnex Url.getUrlOptions
|
||||
exists <- liftIO $ catchDefaultIO False $ Url.exists url uo
|
||||
[whamlet|
|
||||
<a href="#{url}">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue