dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.47k stars 4.76k forks source link

Automatically flag when key JIT data structures get bigger #6754

Open pkukol opened 8 years ago

pkukol commented 8 years ago

It's easy to add new data members (or modify the existing ones) to key JIT struct's and classes without realizing the potential impact on memory consumption (and, indirectly, compile times). There is some logic in the compiler to dump out info about the layout of some struct's but this code is #if'd out for default builds so it's tedious to use and it bit rots easily. The best long term solution seems to be to add a utility to read the debug info from the JIT binary and dump the layout; the latest result would be part of the repo and either the utility itself or the driver invoking would compare the current layout to the "last known" and squawk if anything is seen that could have potentially negative impact on resource consumption (specifically, memory and indirectly time) of the compiler. This should be made a standard step in (almost?) every build. If convenient it might be nice to make the layout dumps friendly to human readers so that folks could also see what's going on easily. This process should probably cover a hand-picked subset of the compiler's structures at first to minimize clutter; the obvious candidates are the GenTree* family, RA data structures, etc.

category:throughput theme:throughput skill-level:intermediate cost:medium

TIHan commented 1 year ago

It would be interesting to gain more insight into how changes to GenTree* and other structures impact memory usage. However, it's not a priority at the moment. Keeping this as future.