开发者

Performance implications of many required files in PHP

开发者 https://www.devze.com 2023-04-04 16:48 出处:网络
Suppose I have over 100 files called in via require_once() command. Is this inducing a significant burden over the load of the server?

Suppose I have over 100 files called in via require_once() command. Is this inducing a significant burden over the load of the server?

If so, what are some possible ways I can reduce this burden while still including th开发者_运维技巧e same number of files.


Yes, requiring lots of files has a significant impact on performance because every file has to be read and parsed on every page load.

Using an opcode cache like APC or one of its many alternatives will reduce this overhead to almost 0 from the second call, as the file will already be parsed and available in the cache.

0

精彩评论

暂无评论...
验证码 换一张
取 消