PHP使用c ++扩展会更快吗? [英] PHP using c++ extension will be faster?

查看:129
本文介绍了PHP使用c ++扩展会更快吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在正在建立一个推荐系统(一个网站)。我想使用PHP作为脚本语言。推荐系统可以进行复杂的矩阵计算或其他。考虑到性能,我想使用C ++做矩阵计算或其他复杂的计算。所以我需要PHP调用C ++函数,获取结果并做其他处理。我知道我可以使用PHP扩展来调用C ++。
我的问题是,我需要使用C ++或只是使用PHP来做复杂的计算?是否使用c ++扩展比纯PHP?

I'm now building a recommender system(a web site). I want to use the PHP as the script language. The recommender system may do complex matrix computing or something else. Considering the performance,I want to use C++ to do matrix computing or other complex computing. So I need the PHP call C++ function, get the result and do other processing. I know I can use the PHP extension to call C++. My question is do I need to use C++ or just use PHP to do the complex computing? Is using c++ extension faster than pure PHP?

推荐答案

是的,使用C ++扩展进行复杂计算将给你一个显着的加速PHP。

Yes, using a C++ extension for complex calculations will give you a significant speedup over PHP.

查看这些问题以了解更多详情:

Check out these questions for more details to go about doing this:

这篇关于PHP使用c ++扩展会更快吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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