How good is PHP performance?

后端 未结 8 1026
你的背包
你的背包 2021-02-02 16:11

This is a follow up to a recent post I\'ve seen which suggests that PHP performance is poor:

\"PHP. IS. ALWAYS. THE. BOTTLENECK. My server farms, let me show you them! P

8条回答
  •  独厮守ぢ
    2021-02-02 16:23

    PHP's performance is fine. Unless you're designing 3d games, of course.

    1. The differences are both negligible and flame-bait. Because, really, is the Rubyism of "who cares if it's fast if it scales?" all that wrong? See #2 for an example of what slows you down.

    2. Anything that takes time. (Ironic, I know.) But really, it always depends on how you do what you do that takes the time. For instance, I can write two queries with nearly identical output but as much as a 2.5x speed increase with the better syntax/choices. By and large, the worst time-waster in a PHP script is file access ... thanks to hardware. So, the number of files you include/require slows down the script more than its contents does—especially when fragmented.

      By this simple system I've manipulated my own MVC framework to be nearly 10x the speed of a bare-boned CodeIgniter application; it's simpler and more minimalist, yes, but it should show that including 1 file, versus 1 per class, can make huge differences in speed.

    3. So long as its *AMP it's good, Linux servers will, or course, be faster. I've been satisfied with both my WAMP and LAMP system, despite vastly different hardware and software differences. (But the LAMP system is, in general, the fastest though the lesser in hardware.)

提交回复
热议问题