You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
msgid"Beyond environment configuration, there are code-level optimizations that can improve your application's performance:"
118
-
msgstr""
119
-
120
-
#. type: Bullet: '- '
121
-
#: en/tutorial/performance-tuning.md
122
-
msgid"Look out for [algorithm complexity](https://en.wikipedia.org/wiki/Time_complexity). Especially give attention to `foreach` within `foreach` loops but look out for using [heavy PHP functions](https://stackoverflow.com/questions/2473989/list-of-big-o-for-php-functions) in loops as well."
123
-
msgstr""
124
-
125
-
#. type: Bullet: '- '
126
-
#: en/tutorial/performance-tuning.md
127
-
msgid"[Speeding up array_merge()](https://www.exakat.io/speeding-up-array_merge/)"
128
-
msgstr""
129
-
130
-
#. type: Bullet: '- '
131
-
#: en/tutorial/performance-tuning.md
132
-
msgid"[Move that foreach() inside the method](https://www.exakat.io/move-that-foreach-inside-the-method/)"
133
-
msgstr""
134
-
135
-
#. type: Bullet: '- '
136
-
#: en/tutorial/performance-tuning.md
137
-
msgid"[Array, classes and anonymous classes memory usage](https://www.exakat.io/array-classes-and-anonymous-memory-usage/)"
138
-
msgstr""
139
-
140
-
#. type: Bullet: '- '
141
-
#: en/tutorial/performance-tuning.md
142
-
msgid"Use fully qualified function names with leading backslashes to optimize opcache performance. When calling [certain global functions](https://github.com/php/php-src/blob/944b6b6bbd6f05ad905f5f4ad07445792bee4027/Zend/zend_compile.c#L4291-L4353) from within a namespace, PHP first searches in the current namespace before falling back to the global namespace. Adding a leading backslash (e.g., `\\count()` instead of `count()`) tells PHP to directly use the global function, avoiding the namespace lookup and improving opcache efficiency. This optimization is best implemented automatically using tools like [PHP-CS-Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) with the `native_function_invocation` rule."
143
-
msgstr""
144
-
145
-
#. type: Plain text
146
-
#: en/tutorial/performance-tuning.md
147
-
msgid"The above optimizations would give you a significant performance boost only if the code in question is executed frequently. That is usually the case for big loops or batch processing."
0 commit comments