Collection of tips and facts on optimizing PHP scripts
This article has long been worth rewriting (too much "saving on matches"), but hands do not reach.Let them weigh and remind us how stupid we are in our youth. One of the main criteria for the success of any online resource is the speed of its work and every year users become more and more demanding according to this criterion. Optimizing the work of php-skips is one of the methods to ensure the speed of the system. In this article I would like to present to the public my collection of tips and facts on optimizing scripts. The collection was going to me for a long time, based on several sources and personal experiments. Why a collection of tips and facts, and not hard and fast rules? Because, as I was convinced, there is no “absolutely correct optimization”. Many techniques and rules are contradictory and it is impossible to fulfill them all. You have to choose a set of methods that are acceptable to use without compromising safety and convenience. I took a recommendatory position and therefore I have tips and facts that you can or may not follow. To avoid confusion, I divided all the tips and facts into 3 groups:
Optimization at the level of logic and organization of the application
Code optimization
Useless optimization
Groups are conditionally highlighted and some items can be attributed to several of them at once. The numbers are for an average server (LAMP). The article does not address issues related to the effectiveness of various third-party technologies and frameworks, as this is a topic for separate discussions.
Optimization at the level of logic and organization of the application
Many of the tips and facts related to this optimization group are very significant and give a very big gain in time.