编译php时enable-inline-optimization做了什么
编译 PHP 时 --enable-inline-optimization 选项到底起什么作用?
为什么人们会使用它?
有什么优点和缺点?
What exactly the --enable-inline-optimization option does when compiling PHP?
And why people would use it?
What are the pros and the cons?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
内联(也称为内联扩展)是一种通过将函数调用替换为编译时调用的函数的实际主体。
它减少了与函数调用和返回相关的一些开销,并且在某些情况下(我不确定 PHP 是否是其中之一)可以允许编译在内联后进一步优化代码区域,例如通过删除具有以下内容的代码:没有效果。
允许编译器执行内联扩展的主要缺点是代码大小的增加,考虑到单个函数调用正在被被调用函数的所有代码替换,这可能会很重要。
启用此配置选项可能会导致 php 脚本速度更快,但文件大小更大。
Inlining (also known as inline expansion) is a way to optimize a program by replacing function calls with the actual body of the function being called at compile-time.
It reduces some of the overhead associated with function calls and returns, and in some cases (I'm not sure if PHP is one of these) can allow the compile to further optimize an area of code after inlining such as by removing code that has no effect.
The main drawback to allowing a compiler to perform inline expansion is the increase in code size, which can be significant considering that the single function call is being replaced with all of the code from the function being called.
Enabling this configuration option will result in potentially faster php scripts that have a larger file size.