Improve bool.TryFormat perf (#18711)
authorStephen Toub <stoub@microsoft.com>
Fri, 29 Jun 2018 17:31:51 +0000 (13:31 -0400)
committerGitHub <noreply@github.com>
Fri, 29 Jun 2018 17:31:51 +0000 (13:31 -0400)
commitc209f0bf2b0eb5bc6e0a35253457e2f9919f28dc
tree36a7f48a3572904127b5d4ef2b1b33ebe23da777
parent13e760637a4162f825cad6ba6cc27706cb96feef
Improve bool.TryFormat perf (#18711)

* Improve bool.TryFormat perf

Improves throughput by ~50%, by avoiding AsSpan().CopyTo and just writing out the characters one-by-one.  I experimented with playing the same tricks around storing the data in a ulong and blitting it out to the destination reinterpreted as a span of ulongs, but it didn't make a measurable improvement and increased the code complexity.

* Update Boolean.cs
src/System.Private.CoreLib/shared/System/Boolean.cs