summaryrefslogtreecommitdiff
path: root/src/mscorlib/shared/System/SpanHelpers.cs
diff options
context:
space:
mode:
authorStephen Toub <stoub@microsoft.com>2018-04-04 22:19:52 -0400
committerStephen Toub <stoub@microsoft.com>2018-04-04 23:52:00 -0400
commitb41c8cc8f60e0c05c79f82ccf9aa82a21b41a280 (patch)
tree4ca0531db24cbfaf5edda47e0d34ea8c87ce349a /src/mscorlib/shared/System/SpanHelpers.cs
parent1acd737dc869218f3e8d2a89bf7fb297fd71e232 (diff)
downloadcoreclr-b41c8cc8f60e0c05c79f82ccf9aa82a21b41a280.tar.gz
coreclr-b41c8cc8f60e0c05c79f82ccf9aa82a21b41a280.tar.bz2
coreclr-b41c8cc8f60e0c05c79f82ccf9aa82a21b41a280.zip
Use FormattingHelpers.Count{Hex}Digits in {u}int/long.ToString/TryFormat
Currently we create a temporary buffer on the stack, format into it, and then copy from that stack buffer into either the target span (for TryFormat) or into a new string (for ToString. Following the approach as (and sharing the same code from) Utf8Formatter, where it first counts the number of digits in the output in order to determine an exact length, this commit changes the implementation to skip the temporary buffer and just format directly into the destination span or string. This results in a very measurable performance boost.
Diffstat (limited to 'src/mscorlib/shared/System/SpanHelpers.cs')
0 files changed, 0 insertions, 0 deletions