If I have code like this:
string s = MyClass.GetString(); // Returns string containing "hello world";
ProcessString(s);
Is this any slower than?
ProcessString(MyClass.GetString());
If so, why? In the second example, is the compiler generally making a variable from the GetString(); method which returns a string?
Also, what is the benefit of declaring variables as late as possible? Does this benefit the GC? If so, how (I'm assuming in terms of GC gens)?
Thanks