How is C# string interpolation compiled? : <p>I know that interpolation is syntactic sugar for <code>string.Format()</code>, but does it have any special behavior/recognition of when it is being used with a string formatting method?</p>

<p>If I have a method:</p>

<pre><code>void Print(string format, params object[] parameters)
</code></pre>

<p>And the following call to it using interpolation:</p>

<pre><code>Print($"{foo} {bar}");
</code></pre>

<p>Which of the following calls lines is most equivalent to the compiled result of string interpolation?</p>

<pre><code>Print(string.Format("{0} {1}", new[] { foo, bar }));
Print("{0} {1}", new[] { foo, bar });
</code></pre>

<p>Reasoning behind the question:  Logging frameworks such as NLog typically defer string formatting until they have determined that a log message will actually be written.  In general I prefer the string interpolation syntax, but I need to know if it may incur an extra performance penalty.</p>
