A few comments mentioned running a profiling tool to prove which has better performance.
This is a ok, but the simplest way to check performance of specific statements is to put them in a loop and use the Stopwatch class.
Jeff Atwood asked about making this sort of timing even simpler in this question. In that question and answer you will also find some good code examples and background details.
Heres a very simple working example:
System.Diagnostics.Stopwatch sw=new System.Diagnostics.Stopwatch();
int a = 5;
string b = "5";
sw.Start();
for (int i=0;i<1000000;i++)
{
if(a == int.Parse(b))
{
}
}
sw.Stop();
Console.WriteLine("a == int.Parse(b) milliseconds: " + sw.ElapsedMilliseconds);
sw.Reset();
sw.Start();
for (int i=0;i<1000000;i++)
{
if(a.ToString() == b)
{
}
}
sw.Stop();
Console.WriteLine("a.ToString() == b milliseconds: " + sw.ElapsedMilliseconds);
On my computer it outputs:
a == int.Parse(b) milliseconds: 521
a.ToString() == b milliseconds: 697
So in this simple scenario int.Parse() is slightly faster, but not enough to really worry about.