Skip to content

HIR Item size reduction - #414

Open
thepowersgang wants to merge 3 commits into
masterfrom
item_size_reduction_PointerWrap
Open

HIR Item size reduction#414
thepowersgang wants to merge 3 commits into
masterfrom
item_size_reduction_PointerWrap

Conversation

@thepowersgang

Copy link
Copy Markdown
Owner

Wrap individual items in HIR::TypeItem and HIR::ValueItem in unique_ptr to save memory.

Testing with libcargo shows total memory usage after Expand (i.e. after all dependent crates loaded) decreasing from 1540MiB to 1100MiB due to the large number of Import variants not wasting 100s of bytes each.

Still working on some more minor space improvements (e.g. in MIR)

…Item) instead of wrapping it

This should reduce memory wasted with imports (which are very common)
- RcString is smaller inline (1 pointer vs 4 on amd64 linux)
- MIR is cloned during monomorph, but the strings don't change, so
  using reference counting should be faster and lower memory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant