1
1
mirror of https://github.com/github/semantic.git synced 2025-01-03 04:51:57 +03:00

Avoid redundant sparking of the outputs.

This commit is contained in:
Rob Rix 2017-05-26 15:08:18 -04:00
parent c167a2a28e
commit 77e0b635d0

View File

@ -6,7 +6,6 @@ module Semantic
, parseBlob
) where
import Control.Parallel.Strategies
import qualified Control.Concurrent.Async as Async
import Data.Functor.Both
import Data.Record
@ -71,4 +70,4 @@ parseBlob decorator SourceBlob{..} = decorator source <$> runParser (parserForLa
renderConcurrently :: (Monoid output, StringConv output ByteString) => (input -> IO output) -> [input] -> IO ByteString
renderConcurrently f diffs = do
outputs <- Async.mapConcurrently f diffs
pure $ toS (mconcat (outputs `using` parTraversable rseq))
pure $ toS (mconcat outputs)