I ran my code through xdebug profiler and saw more than 30 percent of the time is spent on the require() calls. What is the best way to improve on this? I saw some posts about using __autoload, but there were conflicting statements about it's affect on APC (which we use), and doubts about it's use to improve performance.
The reason why requires consume time is disk IO speed. You can try using autoloading, as you may be requiring files that aren't actually used. Another approach to reduce the disk IO overhead is to combine your PHP files into one large file. Requiring a big file which contains the code you always need is faster than including the same code in multiple small files.
Also, APC has a feature which speeds up requires called apc.include_once_override which you can try enabling.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With