tweag/asterius

Make use of precomputed `Int` and `Char` closures in the runtime

Open

#331 opened on Oct 20, 2019

View on GitHub
 (2 comments) (0 reactions) (0 assignees)Haskell (56 forks)batch import
P2good first issuetype: bug

Repository metrics

Stars
 (1,949 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

The ghc rts has precomputed Int and Char closures for small Int and Char values. When the garbage collector finds an Int or Char closure in the dynamic memory which fall into the range, the closure is replaced with a precomputed closure. This trick is based on the assumption that a lot of such closures actually contain small values, and can slightly improve the gc efficiency. We don't implement this trick for now, but it shouldn't be too hard to do so; additionally, rts_mk* functions can also return precomputed closures directly.

Contributor guide