Answer the question
In order to leave comments, you need to log in
Does the amount of PHP code affect performance?
It is clear that 1000 and 1M lines of code will be interpreted at different times. But still, how critical is the amount of code in PHP 7?
Unfortunately, under load it was not necessary to observe the effect.
Do I understand correctly that OPcache was just made to cache the interpreted code?
Answer the question
In order to leave comments, you need to log in
...the question is whether it is possible to collect all the business logic in one class or should it be broken and connected as needed
Do I understand correctly that OPcache was just made to cache the interpreted code?Yes.
You can write such a code that one line will hang everything to hell ...
Much more important is what this code does.
In the Symfony framework, for example, all the necessary application classes are collected in one cache file so that they can be loaded at once, and not one from a thousand files. That is, sometimes one large file is justified. However, it is better to do this automatically (as Symfony does) so as not to impair the readability and maintainability of the code.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question