One of the main reasons for the introduction of the DataValue class was to provide a mechanism to model the run-time type of the object. While this is still necessary for generic support, it is no longer necessary for type-inheritance support, since that was dropped. In addition, a more efficient mechanism could be provided if type-inheritance support were reintroduced.
A potential area where memory consumption could be dramatically reduced is therefore the run-time stack itself. Rather than modeling run-time values using instances of a DataValue, the run-time values could be replaced with native C# values.
Most of these run-time values are value types such as integers and strings, so in addition to reducing the memory required, these values will now be stack-based instead of reference-based, with all the garbage collection overhead that incurs.
At least the following areas need to be considered and modified:
- Run-Time Value Representations
- Run-Time Context
- Standard CLI
- Local Server
- Native CLI
- Stream Support
- Device Marshalling