This article shows that site readers are keenly interested in optimizing their PHP scripts, but some things are controversial, such as quotes.
I personally adhere to the advice of an article on optimizability . He himself checked some figures in percentages, although the article is too old, but it is still relevant.
So, all the tips:
- We take out variables from text lines - acceleration of 25-40%
Short variables no more than 7 characters - acceleration 15%
Do arrays slow down in PHP? Rather, how exactly - 40% acceleration
We take out multidimensional arrays from text strings - acceleration 25-30%
Regular expressions: PHP (POSIX) vs. Perl - acceleration of 60-200%
Loops: for, foreach, while, count / sizeof () - acceleration 15% -30%
To read the file file () faster than fopen + cycle - 40% acceleration
Article author: DEL
Publication Date: June 26, 2007
Link to article: www.habrahabr.ru/blog/webdev/18791.html
Source: https://habr.com/ru/post/11556/
All Articles