Skip to content

Explore converting some datatype declarations to newtype ones.

I spotted some datatype declarations which could be newtype declarations instead to leverage zero-cost abstraction.

  • I tried this in !10708 (merged) and found 20% increase in allocations!
  • This was due to LlvmConfigCache, which must definitely not be a newtype because it alters the laziness semantics.
  • For the rest of the identified declarations no regressions occur.

We should document the importance of data in LlvmConfigCache and can otherwise use newtype declarations for the other cases.

Fix in !10708 (merged)

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information