(1) Introduction This article attempts to explore all aspects of PHP program acceleration, including the necessity and specific measures adopted from different perspectives. Hope to help readers understand the PHP program acceleration and use it in reality. (2) is acceleration required? This mark
(1) Introduction
This article attempts to explore various aspects of PHP program acceleration, including the necessity and specific measures adopted from different perspectives. Hope to help readers understand the PHP program acceleration and use it in reality.
(2) is acceleration required?
This title sounds a little clumsy. In this era, few people may doubt that time is the most valuable fortune, especially in the trade market. The faster the program is to be executed, the more time the user will spend, so that your program can use less time and server resources to serve the user, thus generating more benefits.
I think for most people (including myself), many WEB projects have been completed in a very short time and usually have not been carefully considered and strictly tested. Start a new WEB project. Many people are building the "fast and messy" exploitation, and there is no necessary time to adjust and improve the code. at this time, optimization and acceleration are the measures we must adopt.
However, not all programs require acceleration.
It is a waste of time to optimize the completed code. The best way is to pay attention to the efficiency when writing the code. after the project is completed, only the part that needs to be optimized is optimized. Generally, a program only has a few bottlenecks that affect the speed. you can find and solve them to run the program well. In addition, when the performance is low, we must first look at the overall picture to find out the important factors that affect the efficiency, rather than sticking to the details-for example, if the data volume is too large and the server bandwidth is insufficient, or the hardware configuration is too low. in this case, optimization code is useless.
In addition, when there are no obvious signs of slow performance in the invention program, don't be too picky, it is a waste of time to improve some very detailed code. With this time, you can complete another project or expand your project. Of course, you can joke that I am not responsible enough to do my job well. I can say that you are a perfectionist.
In summary, before you decide to speed up your PHP program, ask yourself if it is necessary.
(3) how to accelerate?
Before replying to the title "how to accelerate", you must first reply to the following two subtitles:
1. where is your program slow?
2. Which of the following aspects can PHP accelerate?
Obviously, I cannot give you an answer to the first subtitle, but I suggest you use the "test script performance speed" method to solve it. Only by identifying the bottleneck that limits the speed can we consider how to solve it.
My general answer to the second subtitle is: code optimization, compressed output, content cache output, function cache output, and acceleration/cache tool software. If you know more, please let me know.
Next we will study the related skills in these aspects. Of course, there are countless details in every aspect to discuss. the following content will inevitably have a one-sided location. please add it.