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

Avoid box allocation in DateTimeFormat.FormatCustomized - #6147

Merged
jkotas merged 1 commit into
dotnet:masterfrom
justinvp:datetimeformat
Jul 7, 2016
Merged

jkotas merged 1 commit into
dotnet:masterfrom
justinvp:datetimeformat

Conversation

@justinvp

@justinvp justinvp commented Jul 6, 2016

Copy link
Copy Markdown

The current implementation calls string.Concat(object, object), which results in an int box allocation.

Avoid the box allocation by calling int.ToString(), allowing string.Concat(string, string) to be used.

The current implementation calls `string.Concat(object, object)`, which
results in an `int` box allocation.

Avoid the box allocation by calling `int.ToString()`, allowing
`string.Concat(string, string)` to be used.
@jkotas

jkotas commented Jul 7, 2016

Copy link
Copy Markdown
Member

LGTM. Thanks!

Could you please port this change to CoreRT as well?

@justinvp

justinvp commented Jul 7, 2016

Copy link
Copy Markdown
Author

Could you please port this change to CoreRT as well?

Done. See dotnet/corert#1481

@justinvp
justinvp deleted the datetimeformat branch July 7, 2016 16:07
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…lr#6147)

The current implementation calls `string.Concat(object, object)`, which
results in an `int` box allocation.

Avoid the box allocation by calling `int.ToString()`, allowing
`string.Concat(string, string)` to be used.

Commit migrated from dotnet/coreclr@62482f5
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