Is it worth compiling a program in C and running it instead of a PHP page?

It seems like most of the time, speed is not worth it, right? otherwise many people will do this for their most popular page. Is there any real benefit from using program C. I can come up with a case when it doesn’t matter: when the network bottleneck on the server is much larger than the bottleneck in the processor, how fast the program works becomes less important.

+3
source share
7 answers

C is a great language. But it was designed for system-level programming without creating web pages. PHP, on the other hand, was designed to create web pages. Use the right tool for the right job. In this case, PHP.

You also start with an erroneous premise. Namely, that PHP will not be fast enough to deliver page content. There are many websites that simply do not agree with this statement. There may be some kind of angular case where C is the only choice for this job, but I find it unlikely that you will come across this scenario.

+8
source

When you use C as a hammer, everything looks like a thumb.

, . C, . PHP vs C - , . -, PHP (, ), , C.

+2

. , c.

0

, , , , C. .

, , C.

0

. , C, ; , CSS.

0

, .

, , i/o CPU , , , C, , , , , .

, - , , C , - .

, C, , , , .

, .NET MVC, # - . C, .

0

( , , , - ).

, ,

  • .
  • C

I would say that a sophisticated raytracing system is a candidate for the situation, but nothing complicated about it.

Even so, I would execute the pages in PHP and run a background job for hard work.

0
source

Source: https://habr.com/ru/post/1708488/


All Articles