Explore putting persistent data structures into compact region
@AndreasK and @bgamari and I (and Hanue) pondered whether it would be worthwhile putting the ModDetails into a compact region. The note explains that the information doesn't change and is essentially a cache. Putting it into a compact region would reduce GC pressure.
It would also be potentially worthwhile to use fixed size arrays rather than lists for its fields.
There are probably other data structures which would benefit from the treatment, perhaps ModIface?
Update: 2020-03-24
A proof of concept that compacting is possible is present on this branch
Roadmap to Compacting a ModIface.
-
Use a type for FastStringbacked by an unpinned ByteArray to implement FastString (!1675 (closed)) (Owner @DanielG) -
(Optional) Reduce allocations as a result of !1675 (closed) by using ShortByteStringin more places rather than converting back to a pinnedByteString. -
(Optional) Remove use of FastStringfrom code gen, in order to be able to remove the cachedlengthfield and cached Z-encoded string fromFastString. (!2949 (closed), owner @sgraf812) -
Remove TyThingfromWiredInnames, see (!2598 (closed), owner @mpickering ) -
Introduce IfaceLiteraltype to remove the use ofTypeinLiteral. (aa293b89, owner @mpickering) -
Separate cache fields from the ModIface, they are functions so can't be compacted (dbe62229, owner @mpickering )
Edited by Sebastian Graf