加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

php – Facebook的HipHop – 它的用途是什么?

发布时间:2020-12-13 16:43:10 所属栏目:PHP教程 来源:网络整理
导读:今天 PHP世界的新闻是 Facebook’s HipHop,其中: HipHop for PHP isn’t technically a compiler itself. Rather it is a source code transformer. HipHop programmatically transforms your PHP source code into highly optimized C++ and then uses g++
今天 PHP世界的新闻是 Facebook’s HipHop,其中:

HipHop for PHP isn’t technically a compiler itself. Rather it is a source code transformer. HipHop programmatically transforms your PHP source code into highly optimized C++ and then uses g++ to compile it. HipHop executes the source code in a semantically equivalent manner and sacrifices some rarely used features — such as eval() — in exchange for improved performance. HipHop includes a code transformer,a reimplementation of PHP’s runtime system,and a rewrite of many common PHP Extensions to take advantage of these performance optimizations.

我的问题是,这实际上对哪种类型的Web应用程序有用?

看起来像典型的数据库绑定的Web应用程序可能不会被这大大提供,但是更少见的CPU绑定应用程序会.

执行大量处理和/或使用大量内存的Web应用程序.显然这个HipHop会减少大约50%的CPU使用率并减少内存使用量(我没有看到任何地方提到的内存使用量会减少多少).这意味着您应该能够使用更少的服务器提供相同数量的请求.

一个额外的好处可能是会有一些基本的类型检查,以确保代码在编译之前是一致的.这应该有助于找到PHP当前由于其弱类型系统而忽略的错误类型.

缺点似乎是它可能不支持PHP的一些更动态的功能,例如eval(尽管可以说这也是一个积极的因素).

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读