利用C ++加速PHP [英] Making use of C++ to speed up PHP

查看:108
本文介绍了利用C ++加速PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Sitepoint上看到这篇文章,引用Rasmus Lerdorf的一段话(根据Sitepoint):


使PHP快速?好吧,你不能是他的快速回答,PHP不够快,不能扩展到雅虎水平,PHP从来不是为了这些任务。任何基于脚本的语言是不够快这是真正大规模的Web系统所必须的,你必须使用编译的C ++扩展来获得真正的,可扩展的体系结构,这就是雅虎做的,所以许多其他PHP重量级。


通过语句(更不用说到目前为止,我在PHP中做的都是小数据库应用程序),我想知道如何使用编译的C ++扩展

解决方案

任何想法或资源PHP是 ...你可以创建一个C ++和PHP的混合,但你需要做大量的剖析来理解什么是慢的,这主要是... PHP。



查看以下内容:





。它是简单的写在PHP与现代的C + + Web框架和良好的知识在C + +。



从哪里开始:




  • CppCMS - 面向性能的可扩展的MVC框架。

  • Wt - 模仿Qt for web的框架(不确定如何扩展)。


I saw this post on Sitepoint quoting a statement by Rasmus Lerdorf which goes (according to Sitepoint) as follows:

How can you make PHP fast? Well, you can’t" was his quick answer. PHP is simply not fast enough to scale to Yahoo levels. PHP was never meant for those sorts of tasks. "Any script based language is simply not fast enough". To get the speed that is necessary for truly massive web systems you have to use compiled C++ extensions to get true, scaleable architecture. That is what Yahoo does and so do many other PHP heavyweights.

Intrigued by the statement (not to mention the fact that up to now, all I was doing in PHP was small database-based applications), I was wondering how I could "use compiled C++ extensions" with PHP.

Any ideas or resources?

解决方案

Don't even bother. PHP is slow... You may create a mixture of C++ and PHP but you'll need to do lots of profiling to understand what is slow. And this is mostly... PHP.

See following:

Just write in C++ in first place. It is as simple as writing in PHP with modern C++ web framework and good knowledge in C++.

Where to start:

  • CppCMS - scalable MVC framework oriented for performance.
  • Wt - framework that mimics Qt for web (not sure how it scales well).

这篇关于利用C ++加速PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆