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
If we import or use FQN call for the global function php produces more optimized code.
Also visible via profilers:
SPX:
Same effect with blackfire:
Without import
with import
Although the optimization might not be that significant for whole codebase it also helps to specify dependency via use statement.
It also might improve performance of some loops when checks like is_array, ltrim, preg_match etc. are used as PHP would no more execute extra opcode INIT_NS_FCALL_BY_NAME
Also by import or FQN core function for setup:di:compile code we might reduce magento compilation time by a few seconds.
Hi @ilnytskyi. Thank you for your report.
To speed up processing of this issue, make sure that you provided sufficient information.
Add a comment to assign the issue: @magento I am working on this
Rule
Reason
I used code example from here
https://tideways.com/profiler/blog/compiler-optimized-php-functions
https://veewee.github.io/blog/optimizing-php-performance-by-fq-function-calls/
If we import or use FQN call for the global function php produces more optimized code.
Also visible via profilers:
SPX:
Same effect with blackfire:
Without import
with import
Although the optimization might not be that significant for whole codebase it also helps to specify dependency via use statement.
It also might improve performance of some loops when checks like
is_array
,ltrim
,preg_match
etc. are used as PHP would no more execute extra opcodeINIT_NS_FCALL_BY_NAME
Also by import or FQN core function for
setup:di:compile
code we might reduce magento compilation time by a few seconds.Implementation
Can be taken from here: https://github.com/slevomat/coding-standard/blob/master/doc/namespaces.md#slevomatcodingstandardnamespacesreferenceusednamesonly-
The text was updated successfully, but these errors were encountered: