Why is C # more efficient than PHP? -Php Tutorial

Source: Internet
Author: User
During the one-day interview, a technology tells me that C # is more efficient than PHP, C # is multi-thread, and PHP is single-thread, I would like to ask how C # multithreading is embodied? How is PHP's single thread reflected? I am a fresh graduate and I am not very interested in basic things. now I am doing some bad work... during the one-day interview, a technology tells me that C # is more efficient than PHP, C # is multi-thread, and PHP is single-thread, I would like to ask how C # multithreading is embodied? How is PHP's single thread reflected? I am a fresh graduate and I am not very interested in basic things. I am trying to make up for it now... reply: whether it is development efficiency or operation efficiency, the inherent weakness of the dynamic type cannot be compensated.
Of course, if you only need hello world... for an interview... In terms of operating efficiency, compiled languages with JIT are naturally better than dynamic languages. Thank you for your invitation.
Above. Above.

Append a sentence:
C # different from PHP use cases. how can this problem be solved? Compared to What ??
Do you dare to compare zagu with me? "C # is more efficient than PHP". if you don't want to go, it will definitely be a hindrance to your future study and growth.

In fact, with a deeper understanding, you will find that C # and PHP cannot be compared at all, because they are not the same species. It's not because everybody can compare anything with Lazarus. Compared with PHP, the http://ASP.NET based on C # is used. Suitable. Of course, if we compare the single thread field separately
PHP does not have multithreading because you cannot start a thread in PHP to execute other tasks. Therefore, multiple requests are sent to the server for processing. The server creates a php script processing process for each user. Therefore, PHP is generally used only for Web development.
C # can do many things that PHP cannot do. C # both Web development and server client-based development. So how important is multithreading for C. You can write a multi-thread crawler to run on the server. C # games can be developed, and a large number of multi-thread processing is used in the game. For example, C # web Development. for example, if a user initiates a request that does not need to return data, the background processing is time-consuming. what should I do? Start a thread and process it slowly. 1. so many languages are stubborn and specific problems.
2. multithreading, poor writing, and low efficiency.
3. since php is being compared, most projects focus on web.
4. focusing on the web, you must deal with databases.
5. poor databases.
6. time and development cycle. It is very important in practice. "C # efficiency is higher than PHP", which means high operation efficiency? Is multithreading higher than a single thread? So is golang longer than C? How does a single thread like node. js work? Php has developed to version 7 very quickly. it can be more efficient than the next bunch of scripting languages. for C #, it is not a single-thread multi-thread issue to compare it with Rust, GO, Swift, and Java.
It is a parsing and compilation problem. I did not need to write for about 7 years C #, 8 years PHP.
On the language level, PHP is more efficient in development, because you don't need to consider processing type conversion. C # divides each type clearly, and it takes a lot of time to convert each other, or even apply the design pattern, PHP has gone to school with arrays all over the world. of course, object orientation is also favored.

At the execution level, C # Uses MSIL as the intermediate language and dynamically compiles the code into native code during execution. PHP uses the source code and dynamically compiles the code during execution, but Opcode can be cached.

Then, at the multi-thread level of the subject, although C # has built-in multi-thread syntax sugar, it still needs a library (like System. Threading) to support it. Of course, it is supported by switching time slices in Windows. By default, PHP does not support multithreading, but pThread extensions also support multithreading.

======================================
All of the above are nonsense. The following are important points:
"PHP is the best language in the world"Their efficiency problems are not evaluated, but the multi-thread and single-thread problems are closely related to efficiency?
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.