Merge pull request #634 from alanz/timing-pr2

Speed up map-file loading
This commit is contained in:
Daniel Gröber 2015-10-11 21:55:32 +02:00
commit df1f9bb33f
2 changed files with 9 additions and 7 deletions

View File

@ -69,7 +69,7 @@
(save-restriction
(widen)
(process-send-region pro (point-min) (point-max))))
(process-send-string pro "\004\n")
(process-send-string pro "\n\004\n")
(condition-case nil
(let ((inhibit-quit nil))
(while ghc-process-file-mapping

View File

@ -504,12 +504,14 @@ legacyInteractiveLoop symdbreq world = do
getFileSourceFromStdin :: IO String
getFileSourceFromStdin = do
let loop' acc = do
line <- getLine
if not (null line) && last line == '\EOT'
then return $ acc ++ init line
else loop' (acc++line++"\n")
loop' ""
linesIn <- readStdin'
return (intercalate "\n" linesIn)
where
readStdin' = do
x <- getLine
if x/="\EOT"
then fmap (x:) readStdin'
else return []
-- Someone please already rewrite the cmdline parsing code *weep* :'(
wrapGhcCommands :: (IOish m, GmOut m) => Options -> [String] -> m ()