PHP performance

前端 未结 13 2211
庸人自扰
庸人自扰 2020-12-28 19:03

What can I do to increase the performance/speed of my PHP scripts without installing software on my servers?

13条回答
  •  梦毁少年i
    2020-12-28 19:52

    including files is slow, and requiring them is even slower. If you use __autoload for including every class then that will add up. for example.

    I'm always a bit wary of trying to be too clever in terms of code optimisation, if it sacrifices code clairty. If you need to make code obscure to make it fast, would it not be cheaper to upgrade hardwear instead of wasting your time trying to tweak code? Processor cycles are cheaper than programmer cycles, after all.

提交回复
热议问题