[Git][ghc/ghc][wip/fendor/fix-thunks-name-and-ui] Eliminate name thunk in declaration fingerprinting

Hannes Siebenhandl (@fendor) gitlab at gitlab.haskell.org
Thu Apr 4 12:39:23 UTC 2024



Hannes Siebenhandl pushed to branch wip/fendor/fix-thunks-name-and-ui at Glasgow Haskell Compiler / GHC


Commits:
e2de39aa by Fendor at 2024-04-04T14:39:16+02:00
Eliminate name thunk in declaration fingerprinting

Thunk analysis showed that we have about 100_000 thunks (in agda and
`-fwrite-simplified-core`) pointing to the name of the name decl.
Forcing this thunk fixes this issue.

- - - - -


1 changed file:

- compiler/GHC/IfaceToCore.hs


Changes:

=====================================
compiler/GHC/IfaceToCore.hs
=====================================
@@ -956,7 +956,10 @@ tc_iface_decl_fingerprint :: Bool                    -- Don't load pragmas into
 tc_iface_decl_fingerprint ignore_prags (_version, decl)
   = do  {       -- Populate the name cache with final versions of all
                 -- the names associated with the decl
-          let main_name = ifName decl
+          let !main_name = ifName decl
+                -- Thunk analysis showed we retain a lot of thunks here.
+                -- Thus, force it, it reduces the numbers of thunks in GHCi
+                -- session noticeably.
 
         -- Typecheck the thing, lazily
         -- NB. Firstly, the laziness is there in case we never need the



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e2de39aa82420a30ff04814adb65d28ddb787455

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e2de39aa82420a30ff04814adb65d28ddb787455
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/20240404/d28dda37/attachment.html>


More information about the ghc-commits mailing list