[Git][ghc/ghc][wip/mpickering-hannes] Remove traces and profiling
Matthew Pickering (@mpickering)
gitlab at gitlab.haskell.org
Wed Mar 20 10:57:41 UTC 2024
Matthew Pickering pushed to branch wip/mpickering-hannes at Glasgow Haskell Compiler / GHC
Commits:
2b8cbe10 by Matthew Pickering at 2024-03-20T10:57:32+00:00
Remove traces and profiling
- - - - -
2 changed files:
- compiler/GHC/Iface/Binary.hs
- compiler/GHC/Utils/Binary.hs
Changes:
=====================================
compiler/GHC/Iface/Binary.hs
=====================================
@@ -215,10 +215,9 @@ getTables' name_cache bh = do
-- bh_name2 = addDecoder (mkCache (Proxy :: Proxy IfaceTyCon) ifaceDecoder) bh_name
- pprTraceM "getTables" empty
ifaceSymTab2 <- Binary.forwardGet bh_name (getTable ifaceTypeCache bhRef bh_name)
let ifaceDecoder2 = mkReader $ getGenericSymtab ifaceSymTab2
- let bh_type = addDecoder (mkCache (Proxy :: Proxy IfaceType) (pprTrace "forced" (text "f") ifaceDecoder2)) bh_name
+ let bh_type = addDecoder (mkCache (Proxy :: Proxy IfaceType) ifaceDecoder2) bh_name
writeIORef bhRef bh_type
return bh_type
=====================================
compiler/GHC/Utils/Binary.hs
=====================================
@@ -206,9 +206,11 @@ data BinProf = BinProf { stack :: ![ProfKey], report :: IORef (Map.Map [ProfKey]
initBinProf = BinProf <$> pure [StringKey "TOP"] <*> newIORef (Map.empty)
addStack :: TypeRep -> BinProf -> BinProf
+addStack _ bp = bp
addStack s (BinProf ss i) = (BinProf (TypeableKey s:ss) i)
recordSample :: Int -> BinProf -> IO ()
+recordSample _ _ = return ()
recordSample weight (BinProf ss i) = modifyIORef i (Map.insertWith (+) ss weight)
-- XXX: should really store a "high water mark" for dumping out
-- the binary data to a file.
@@ -1231,7 +1233,6 @@ putGenericSymbolTable gen_sym_tab serialiser bh = do
case vs of
[] -> return table_count
todo -> do
- print (map fst todo)
mapM_ (\n -> lazyPut' serialiser bh n) (map snd vs)
loop table_count
snd <$>
@@ -1245,7 +1246,7 @@ getGenericSymbolTable deserialiser bhRef bh = do
forM_ [0..(sz-1)] $ \i -> do
f <- lazyGet' (Just bhRef) deserialiser bh
writeArray mut_arr i f
- pprTraceM "gotten" (ppr sz)
+-- pprTraceM "gotten" (ppr sz)
unsafeFreeze mut_arr
putGenericSymTab :: (Ord a, Binary a) => GenericSymbolTable a -> BinHandle -> a -> IO ()
@@ -1267,7 +1268,7 @@ getGenericSymtab :: Binary a => SymbolTable a
-> BinHandle -> IO a
getGenericSymtab symtab bh = do
i :: Word32 <- get bh
- pprTraceM "getting" (ppr (bounds symtab, i))
+-- pprTraceM "getting" (ppr (bounds symtab, i))
return $! symtab ! fromIntegral i
data SomeCache = forall a . SomeCache (TypeRep, CachedBinary a)
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2b8cbe10266f7ea9b25a544175ff4bae9afcc29d
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2b8cbe10266f7ea9b25a544175ff4bae9afcc29d
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240320/3463ce12/attachment-0001.html>
More information about the ghc-commits
mailing list