haskell / haskell/binary

Deserializing many TypeReps may lead to high residency

Open
#143 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
120
Forks
70
PR merge metrics
No merged PRs in 30d

Description

Deserialized `TypeRep`s don't share any structure with each other, which can potentially waste a lot of space. For example, if I fill a giant `Set` with deserialized `Dynamic` values, the lion's share of the space could be taken up by the `TypeRep`s. One potential fix would be to maintain weak tables holding deserialized `TyCon`s and `TypeRep`s. We could use one of type `Map Fingerprint (exists a. Weak (TypeRep a))` and one of type `Map Fingerprint (Weak TyCon)`, but other sorts of maps would probably be faster. When a (perhaps recursively) deserialized `TyCon` or `TypeRep` matches one stored in the table, it would be thrown away in favor of the stored one.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.