Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Avoid boxing, object[], and string[] allocations in BuildTraceFileName #21752

Merged
merged 1 commit into from
Jan 2, 2019

Conversation

stephentoub
Copy link
Member

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 stephentoub requested a review from brianrob January 2, 2019 15:42
@stephentoub stephentoub changed the title Avoid boxing allocation, object[], and string[] allocations in BuildTraceFileName Avoid boxing, object[], and string[] allocations in BuildTraceFileName Jan 2, 2019
Copy link
Member

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Copy link
Member

@brianrob brianrob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@brianrob
Copy link
Member

brianrob commented Jan 2, 2019

cc: @noahfalk, @jorive

@stephentoub stephentoub merged commit 0c5ab47 into dotnet:master Jan 2, 2019
@stephentoub stephentoub deleted the buildtracefilename branch January 2, 2019 18:41
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants