Avoid boxing, object[], and string[] allocations in BuildTraceFileName by stephentoub · Pull Request #21752 · dotnet/coreclr (original) (raw)
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
This was calling the string.Concat(object[]) overload, which entailed boxing the process ID and allocating an object[]; then string.Concat would allocate a string[] to store the ToString results of all arguments. By calling ToString on the process ID ourselves, we avoid the boxing, the object[], and the string[] (there's a four-string Concat overload).
stephentoub changed the title
Avoid boxing allocation, object[], and string[] allocations in BuildTraceFileName Avoid boxing, object[], and string[] allocations in BuildTraceFileName
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
picenka21 pushed a commit to picenka21/runtime that referenced this pull request