简体   繁体   English

php vs C ++ / Java用于密集处理,内存差异?

[英]php vs C++/Java for intensive processing, memory difference?

I have a php curl script that uses 10 MB per running session. 我有一个PHP curl脚本,每个运行会话使用10 MB。

I'd like to scale things and add more requests but the curl and processing must be taking up too much memory. 我想扩展事物并添加更多请求,但是卷曲和处理必须占用太多内存。 (I want to add like a 100,000 sessions) (我想增加100,000个会话)

If I had a server side C++ routine would the memory difference be that much different? 如果我有服务器端C ++例程,那么内存差异会相差那么多吗? I don't want to re-write the whole thing if it really isn't. 如果不是真的,我不想重写整个内容。

Is there a C++/Java method to keep a rolling curl going? 是否有C ++ / Java方法来保持滚动状态?

Thanks! 谢谢!

Well it totally depends what you are writing and how you write it. 好吧,这完全取决于您在写什么以及如何编写。 I'd be very surprised if you couldn't cut the memory footprint down using C++ though ... 如果您不能使用C ++减少内存占用,我会感到非常惊讶。

PHP is getting better with performance all the time, but it is still a fairly heavy language. PHP的性能一直在不断提高,但是它仍然是一种繁重的语言。 If you were to use C/C++, you would definutely see major performance increases. 如果要使用C / C ++,肯定会看到性能的大幅提高。 For anything under high load, you definutely need to move away from PHP to a more performance-oriented application. 对于任何承受高负载的事情,您绝对需要从PHP转向更注重性能的应用程序。

That said, I do agree with Goz. 就是说,我确实同意Goz。 It totally depends on what you are writing, as to what the performance increase will be. 这将完全取决于您所写的内容以及性能的提高。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM