asterius icon indicating copy to clipboard operation
asterius copied to clipboard

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

Open TerrorJack opened this issue 6 years ago • 2 comments

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.

TerrorJack avatar Oct 20 '19 08:10 TerrorJack

Closed by https://github.com/tweag/asterius/pull/534.

gkaracha avatar Apr 02 '20 06:04 gkaracha

Let's keep this one open for now. rts_mkInt/rts_mkChar functions can return precomputed closures now, but the garbage collector doesn't use them yet.

TerrorJack avatar Apr 02 '20 15:04 TerrorJack