Shink NodeId, CrateNum, Name and Mrk down to 32 bits on x64. #10670
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rationale
There is no reason to support more than 2³² nodes or names at this moment, as compiling something that big (even without considering the quadratic space usage of some analysis passes) would take at least 64GB.
Meanwhile, some can't (or barely can) compile rustc because it requires almost 1.5GB.
Potential problems
Can someone confirm this doesn't affect metadata (de)serialization? I can't tell myself, I know nothing about it.
Results
Some structures have a size reduction of 25% to 50%: before - after.
Sadly, there isn't a massive change in the memory used for compiling stage2 librustc (it doesn't go over 1.4GB as before, but I can barely see the difference).
However, my own testcase (previously peaking at 1.6GB in typeck) shows a reduction of 200-400MB.