Closed cdmihai closed 3 years ago
I believe most of this has been addressed by LazyFormattedBuildEventArgs. There was a bug related to minimal verbosity and improper usage of LazyFormattedBuildEventArgs - #5924
Please reopen if it remains relevant.
Formatted msbuild resource strings eventually get sent to loggers, which eventually write them to some stream. Most StreamWriters have overloads (or will have) for formatting. Therefore it is pointless to convert formatted resources into strings, if they're final resting place is some buffer anyway.
An interesting experiment would be to put the resource and its arguments into some struct, and then propagate that struct all the way into loggers, which then can format them directly into their streams / string builders / etc.
Building WebLargeCore with minimal verbosity creates 74mb of formatted resources:
And in a broader sense, we should look for cases where we strinbbuild or format strings just to then later put them in some buffer. Patterns that will help