+3  A: 

It's not a lot of time, but yes. it takes time.

In this example the text "hello" would already live somewhere as a constant value, but str would have to be set to point to it at runtime.

and the value 3 would have to be stored in num

John Knoeller
Where is this "somewhere"? The read-only section of the binary?
Dor
@Dor: in MSVC it will be in a read-only section of the binary, I don't know about other compilers.
John Knoeller
Compile to assembly (e.g. gcc -S) and see for yourself.
Nikolai N Fetissov
@Nikolai: 10X, but I'm not yet smart enough to understand x86 ASM or a binary file format.
Dor
A: 

If you're feeling adventurous, try dissasembling your executable with objdump with and without extra variables. You'll see that there are extra instructions inserted by the compiler (either setting a register or doing a load operation) when you create more local variables in your function. Every instruction takes nonzero time...

Sam Post
A: 

Though is a small time isn't it depend on the task you are performing? Consider a video streaming application which require faster method invocation??

Dattha