Answered by:
Faster to compare ToString() or Equal()?
Question

Answers

Interesting question. There's only one way to find out: benchmark it.
And the results are:
Tested with the number 500 (10 million iterations):
ToString() = 4.59 seconds
Parse() = 4.44 seconds
Tested with the number 5 (10 million iterations):
ToString() = 3.73 seconds
Parse() = 4.15 seconds
Too close to call. For single digit numbers, ToString() is a little faster, for 3 digits, Parse() is a little faster
But the difference is minimal.
All replies

Interesting question. There's only one way to find out: benchmark it.
And the results are:
Tested with the number 500 (10 million iterations):
ToString() = 4.59 seconds
Parse() = 4.44 seconds
Tested with the number 5 (10 million iterations):
ToString() = 3.73 seconds
Parse() = 4.15 seconds
Too close to call. For single digit numbers, ToString() is a little faster, for 3 digits, Parse() is a little faster
But the difference is minimal.

Another thing to consider is that you won't necessarily get the same result from the two comparisons for all values of number.
For example, o.Equals(int.Parse(number)) will return true and the other comparison false if o is = 1 and number contains a string such as
"+1"
"001"
