What is the cost of a function call?

后端 未结 15 742
天命终不由人
天命终不由人 2020-12-12 22:34

Compared to

  • Simple memory access
  • Disk access
  • Memory access on another computer(on the same network)
  • Disk access on another computer
15条回答
  •  [愿得一人]
    2020-12-12 23:07

    If the function is inlined at compile time, the cost of the function becomes equivelant to 0.

    0 of course being, what you would have gotten by not having a function call, ie: inlined it yourself.

    This of course sounds excessively obvious when I write it like that.

提交回复
热议问题