Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><code>System.Int32.Parse</code> is slowlest, because it used <code>CultureInfo</code>, <code>FormatInfo</code> and etc; and performance reason is not in the temporary strings.</p> <p>Code from reflection:</p> <pre><code>private unsafe static bool ParseNumber(ref char* str, NumberStyles options, ref Number.NumberBuffer number, NumberFormatInfo numfmt, bool parseDecimal) { number.scale = 0; number.sign = false; string text = null; string text2 = null; string str2 = null; string str3 = null; bool flag = false; string str4; string str5; if ((options &amp; NumberStyles.AllowCurrencySymbol) != NumberStyles.None) { text = numfmt.CurrencySymbol; if (numfmt.ansiCurrencySymbol != null) { text2 = numfmt.ansiCurrencySymbol; } str2 = numfmt.NumberDecimalSeparator; str3 = numfmt.NumberGroupSeparator; str4 = numfmt.CurrencyDecimalSeparator; str5 = numfmt.CurrencyGroupSeparator; flag = true; } else { str4 = numfmt.NumberDecimalSeparator; str5 = numfmt.NumberGroupSeparator; } int num = 0; char* ptr = str; char c = *ptr; while (true) { if (!Number.IsWhite(c) || (options &amp; NumberStyles.AllowLeadingWhite) == NumberStyles.None || ((num &amp; 1) != 0 &amp;&amp; ((num &amp; 1) == 0 || ((num &amp; 32) == 0 &amp;&amp; numfmt.numberNegativePattern != 2)))) { bool flag2; char* ptr2; if ((flag2 = (((options &amp; NumberStyles.AllowLeadingSign) == NumberStyles.None) ? false : ((num &amp; 1) == 0))) &amp;&amp; (ptr2 = Number.MatchChars(ptr, numfmt.positiveSign)) != null) { num |= 1; ptr = ptr2 - (IntPtr)2 / 2; } else { if (flag2 &amp;&amp; (ptr2 = Number.MatchChars(ptr, numfmt.negativeSign)) != null) { num |= 1; number.sign = true; ptr = ptr2 - (IntPtr)2 / 2; } else { if (c == '(' &amp;&amp; (options &amp; NumberStyles.AllowParentheses) != NumberStyles.None &amp;&amp; (num &amp; 1) == 0) { num |= 3; number.sign = true; } else { if ((text == null || (ptr2 = Number.MatchChars(ptr, text)) == null) &amp;&amp; (text2 == null || (ptr2 = Number.MatchChars(ptr, text2)) == null)) { break; } num |= 32; text = null; text2 = null; ptr = ptr2 - (IntPtr)2 / 2; } } } } c = *(ptr += (IntPtr)2 / 2); } int num2 = 0; int num3 = 0; while (true) { if ((c &gt;= '0' &amp;&amp; c &lt;= '9') || ((options &amp; NumberStyles.AllowHexSpecifier) != NumberStyles.None &amp;&amp; ((c &gt;= 'a' &amp;&amp; c &lt;= 'f') || (c &gt;= 'A' &amp;&amp; c &lt;= 'F')))) { num |= 4; if (c != '0' || (num &amp; 8) != 0) { if (num2 &lt; 50) { number.digits[(IntPtr)(num2++)] = c; if (c != '0' || parseDecimal) { num3 = num2; } } if ((num &amp; 16) == 0) { number.scale++; } num |= 8; } else { if ((num &amp; 16) != 0) { number.scale--; } } } else { char* ptr2; if ((options &amp; NumberStyles.AllowDecimalPoint) != NumberStyles.None &amp;&amp; (num &amp; 16) == 0 &amp;&amp; ((ptr2 = Number.MatchChars(ptr, str4)) != null || (flag &amp;&amp; (num &amp; 32) == 0 &amp;&amp; (ptr2 = Number.MatchChars(ptr, str2)) != null))) { num |= 16; ptr = ptr2 - (IntPtr)2 / 2; } else { if ((options &amp; NumberStyles.AllowThousands) == NumberStyles.None || (num &amp; 4) == 0 || (num &amp; 16) != 0 || ((ptr2 = Number.MatchChars(ptr, str5)) == null &amp;&amp; (!flag || (num &amp; 32) != 0 || (ptr2 = Number.MatchChars(ptr, str3)) == null))) { break; } ptr = ptr2 - (IntPtr)2 / 2; } } c = *(ptr += (IntPtr)2 / 2); } bool flag3 = false; number.precision = num3; number.digits[(IntPtr)num3] = '\0'; if ((num &amp; 4) != 0) { if ((c == 'E' || c == 'e') &amp;&amp; (options &amp; NumberStyles.AllowExponent) != NumberStyles.None) { char* ptr3 = ptr; c = *(ptr += (IntPtr)2 / 2); char* ptr2; if ((ptr2 = Number.MatchChars(ptr, numfmt.positiveSign)) != null) { c = *(ptr = ptr2); } else { if ((ptr2 = Number.MatchChars(ptr, numfmt.negativeSign)) != null) { c = *(ptr = ptr2); flag3 = true; } } if (c &gt;= '0' &amp;&amp; c &lt;= '9') { int num4 = 0; do { num4 = num4 * 10 + (int)(c - '0'); c = *(ptr += (IntPtr)2 / 2); if (num4 &gt; 1000) { num4 = 9999; while (c &gt;= '0' &amp;&amp; c &lt;= '9') { c = *(ptr += (IntPtr)2 / 2); } } } while (c &gt;= '0' &amp;&amp; c &lt;= '9'); if (flag3) { num4 = -num4; } number.scale += num4; } else { ptr = ptr3; c = *ptr; } } while (true) { if (!Number.IsWhite(c) || (options &amp; NumberStyles.AllowTrailingWhite) == NumberStyles.None) { bool flag2; char* ptr2; if ((flag2 = (((options &amp; NumberStyles.AllowTrailingSign) == NumberStyles.None) ? false : ((num &amp; 1) == 0))) &amp;&amp; (ptr2 = Number.MatchChars(ptr, numfmt.positiveSign)) != null) { num |= 1; ptr = ptr2 - (IntPtr)2 / 2; } else { if (flag2 &amp;&amp; (ptr2 = Number.MatchChars(ptr, numfmt.negativeSign)) != null) { num |= 1; number.sign = true; ptr = ptr2 - (IntPtr)2 / 2; } else { if (c == ')' &amp;&amp; (num &amp; 2) != 0) { num &amp;= -3; } else { if ((text == null || (ptr2 = Number.MatchChars(ptr, text)) == null) &amp;&amp; (text2 == null || (ptr2 = Number.MatchChars(ptr, text2)) == null)) { break; } text = null; text2 = null; ptr = ptr2 - (IntPtr)2 / 2; } } } } c = *(ptr += (IntPtr)2 / 2); } if ((num &amp; 2) == 0) { if ((num &amp; 8) == 0) { if (!parseDecimal) { number.scale = 0; } if ((num &amp; 16) == 0) { number.sign = false; } } str = ptr; return true; } } str = ptr; return false; } public static int Parse(string s) { return Number.ParseInt32(s, NumberStyles.Integer, NumberFormatInfo.CurrentInfo); } internal unsafe static int ParseInt32(string s, NumberStyles style, NumberFormatInfo info) { byte* stackBuffer = stackalloc byte[1 * 114 / 1]; Number.NumberBuffer numberBuffer = new Number.NumberBuffer(stackBuffer); int result = 0; Number.StringToNumber(s, style, ref numberBuffer, info, false); if ((style &amp; NumberStyles.AllowHexSpecifier) != NumberStyles.None) { if (!Number.HexNumberToInt32(ref numberBuffer, ref result)) { throw new OverflowException(Environment.GetResourceString("Overflow_Int32")); } } else { if (!Number.NumberToInt32(ref numberBuffer, ref result)) { throw new OverflowException(Environment.GetResourceString("Overflow_Int32")); } } return result; } private unsafe static void StringToNumber(string str, NumberStyles options, ref Number.NumberBuffer number, NumberFormatInfo info, bool parseDecimal) { if (str == null) { throw new ArgumentNullException("String"); } fixed (char* ptr = str) { char* ptr2 = ptr; if (!Number.ParseNumber(ref ptr2, options, ref number, info, parseDecimal) || ((ptr2 - ptr / 2) / 2 &lt; str.Length &amp;&amp; !Number.TrailingZeros(str, (ptr2 - ptr / 2) / 2))) { throw new FormatException(Environment.GetResourceString("Format_InvalidString")); } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload