+6  A: 

Someone asked that question on here already. In short, no, the IL code generated is the same. Therefore, no perf hit. If you ever wonder how one way of doing something differs from another, just write a sample and then use Reflector to analyze the differences.

Kilhoffer
then the question should be closed as duplicate, shouldn't it?
ax
Thanks for the link. I searched SO, but couldnt find anything about this.
+5  A: 

No, var is just syntactical sugar. It doesn't actually get compiled into MSIL. Give a try compiling some code with the var keyword and without, then open the assembly in Reflector to see for yourself.

Bob
+4  A: 

Since this is a compile-time feature, there could conceivably be slower compilation times, but not slower run-times.

Gary McGill
Yes. It can add many nanoseconds to your build.
Henk Holterman
+2  A: 

This feature is called type inference. Compiler will infer the correct type at compile time and the msil generated will contain the correct type

Tinku
+1  A: 

Does he mean at compile time or at runtime?

At runtime, it is not possible to have a performance hit. The var keyword is handled entirely by the compiler, and it is completley impossible to tell from the IL whether the var keyword was used. Your friend might be thinking of C# 4's new dynamic keyword, which does have a performance impact.

At compile time, there might be a tiny performance impact, but it's nothing to worry about.

SLaks