summaryrefslogtreecommitdiff
path: root/compiler/iface
diff options
context:
space:
mode:
authorAndreas Klebinger <klebinger.andreas@gmx.at>2019-10-20 02:30:01 +0200
committerAndreas Klebinger <klebinger.andreas@gmx.at>2019-10-21 16:06:10 +0200
commit11f53e604ac6f7029ae8a9e8f4247576490839d4 (patch)
treef07df8a51d7514d29b5df8a11896b8f32093f45a /compiler/iface
parentc4c9904b324736dc5d190a91418e8d8f564d4104 (diff)
downloadhaskell-wip/andreask/withTimingRefactor.tar.gz
Make dynflag argument for withTiming pure.wip/andreask/withTimingRefactor
19 times out of 20 we already have dynflags in scope. We could just always use `return dflags`. But this is in fact not free. When looking at some STG code I noticed that we always allocate a closure for this expression in the heap. Clearly a waste in these cases. For the other cases we can either just modify the callsite to get dynflags or use the _D variants of withTiming I added which will use getDynFlags under the hood.
Diffstat (limited to 'compiler/iface')
-rw-r--r--compiler/iface/LoadIface.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/iface/LoadIface.hs b/compiler/iface/LoadIface.hs
index 446477d018..6da6565219 100644
--- a/compiler/iface/LoadIface.hs
+++ b/compiler/iface/LoadIface.hs
@@ -400,7 +400,7 @@ loadInterface doc_str mod from
-- Redo search for our local hole module
loadInterface doc_str (mkModule (thisPackage dflags) (moduleName mod)) from
| otherwise
- = withTimingSilent getDynFlags (text "loading interface") (pure ()) $
+ = withTimingSilentD (text "loading interface") (pure ()) $
do { -- Read the state
(eps,hpt) <- getEpsAndHpt
; gbl_env <- getGblEnv