runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Reduce memory consumption of the JIT by eliminating padding etc

Open pkukol opened this issue 10 years ago • 1 comments

The "struct GenTree_" family is the most obvious example of this, though other important JIT data structures should be checked as well - make sure there is no unnecessary padding (due to data member alignment), see if data members could be rearranged to reduce overall size, and specifically in the case of GenTree_ make sure the sizes of the "small" vs. "large" nodes (and which GenTree* flavors are marked as always having to be "large") are optimized.

category:throughput theme:jit-coding-style skill-level:intermediate cost:small impact:small

pkukol avatar Oct 03 '16 14:10 pkukol

though other important JIT data structures should be checked as well

One set of structures that may be worth a look is Referenceable, RegRecord, Interval and RefPosition. Referenceable (the base class) has 3 pointers and a bool so it wastes 7 bytes (on x64). Interval has an int placed before a pointer so it wastes another 4 bytes. RefPosition has some problems with the way VC++ allocates bit fields and seems to be 8 bytes larger than it could be.

mikedn avatar Oct 03 '16 16:10 mikedn