Improve Int32/Int64 {Try}Parse performance for NumberStyles.Integer (#18897)
authorStephen Toub <stoub@microsoft.com>
Fri, 13 Jul 2018 21:43:34 +0000 (17:43 -0400)
committerGitHub <noreply@github.com>
Fri, 13 Jul 2018 21:43:34 +0000 (17:43 -0400)
commit78fc03b0755ac3c428d5f6c8f30b50af65d0e0a8
treed20a906b8585c074eeb151174f3cdd17178a40b7
parentdc7492e227f0ff1a5054337091c5ce7105e82491
Improve Int32/Int64 {Try}Parse performance for NumberStyles.Integer (#18897)

Special-case the default NumberStyles.Integer format to improve the throughput of Int32/Int64.{Try}Parse.  Ports the implementation from Utf8Parser, modifying it to accomodate the additional cases needed for Int32/Int64, e.g. culture impact on positive and negative signs, trailing zeros, leading and trailing whitespace, prohibiting additional characters at the end, etc.
src/System.Private.CoreLib/shared/System/Number.Parsing.cs