What is the cost of a function call?

后端 未结 15 783
天命终不由人
天命终不由人 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:08

    Only memory access is faster than a function call.

    But the call can be avoided if compiler with inline optimization (for GCC compiler(s) and not only it is activated when using level 3 of optimization (-O3) ).

提交回复
热议问题