Reply: "Golang VS PHP Performance Comparison"

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

Connection: http://www.oschina.net/question/29420_138135

See a blog post about Golang and PHP performance comparison, here to reply. The results of this test are clearly misleading.

1,php The Opcache is not turned on, read the disk file every time. and compile php for opcode. Performance naturally will be poor, open opcache try it.

2, Php+redis must be extended version of the Redis client, because the Redis extension is long-connected, you can avoid the network overhead of short connections.

3, php-fpm or Apache, even if only 20 processes are opened. The pure memory operation of Redis absolutely can return the result within 2ms (2ms is already very poor, generally 0.5ms can get a response). Then each process can provide at least 500QPS of processing power (2ms1 times, the PHP process is serially executed, 1 seconds can be 500 times). 20 processes can provide at least tens of thousands of QPS.

4, Redis/mysql if there are such operations, then the bottleneck of the program must be on the IO. Don't say Golang and PHP performance gap is not too big, even with the assembler rewrite and PHP will not be too big gap. There is no intensive calculation at all. Static language, dynamic language is only the language itself has performance differences, and Io Independent.

5, large concurrency and QPS are irrelevant. The concurrency in the test is also small, and the-C parameter for AB is 200. 200 is not high concurrency.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.