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
ModIface
.
Roadmap to Compacting a -
Use a type for FastString
backed by an unpinned ByteArray to implement FastString (!1675 (closed)) (Owner @DanielG) -
(Optional) Reduce allocations as a result of !1675 (closed) by using ShortByteString
in more places rather than converting back to a pinnedByteString
. -
(Optional) Remove use of FastString
from code gen, in order to be able to remove the cachedlength
field and cached Z-encoded string fromFastString
. (!2949 (closed), owner @sgraf812) -
Remove TyThing
fromWiredIn
names, see (!2598, owner @mpickering ) -
Introduce IfaceLiteral
type to remove the use ofType
inLiteral
. (aa293b89, owner @mpickering) -
Separate cache fields from the ModIface
, they are functions so can't be compacted (dbe62229, owner @mpickering )