msbuild icon indicating copy to clipboard operation
msbuild copied to clipboard

Consider deleting BuildEventArgs.ThreadId

Open KirillOsenkov opened this issue 4 years ago • 5 comments

BuildEventArgs.ThreadId appears to be unused: https://source.dot.net/#Microsoft.Build.Framework/BuildEventArgs.cs,e7fedb352ddef2cb,references

Consider deleting it to save memory and perf.

KirillOsenkov avatar Feb 12 '21 20:02 KirillOsenkov

Team Triage: @KirillOsenkov it looks like the property is read by many FormatEventMessage overloads. Are you saying that there is opportunity to refactor the code further to make it redundant? If so, can you please elaborate?

ladipro avatar Feb 18 '21 12:02 ladipro

I guess my question is even if it’s currently used, how useful is it? What is it for?

KirillOsenkov avatar Feb 18 '21 17:02 KirillOsenkov

@rainersigwald do you think I can kill ThreadId?

KirillOsenkov avatar Apr 26 '21 05:04 KirillOsenkov

I can't think of a reason why it would ever be very useful. However, since it's an ancient public field I'm a bit worried about impact to third-party folks who saw it and access it even if it's not useful.

I'd be willing to deprecate + always return 0 or something for 17.0, I think, but am hesitant to outright remove.

rainersigwald avatar Apr 26 '21 15:04 rainersigwald

Yup, sounds good

KirillOsenkov avatar Apr 26 '21 16:04 KirillOsenkov