Clean up ParseNumbers and fix perf regressions
authorStephen Toub <stoub@microsoft.com>
Mon, 18 Sep 2017 18:22:02 +0000 (14:22 -0400)
committerStephen Toub <stoub@microsoft.com>
Mon, 18 Sep 2017 23:52:08 +0000 (19:52 -0400)
commit8390c4213e60a5cc2507e133f158cbf530b70b1d
treeb0a011cba495dae502f3a0510b1af3a376a78390
parent503aa1ce2b4cad5baae945972e7fbf0057b6b44c
Clean up ParseNumbers and fix perf regressions

- Fix formatting
- Replace char[] allocations with stackalloc
- Replace StringBuilders with FastAllocateString
- Tweak a few comparisons to make them leaner
- Tweak some tight loops to make them a bit leaner
- Help JIT to eliminate bounds checks on target spans
- Walk ptr destinations rather than indexing
src/mscorlib/src/System/ParseNumbers.cs