开发者

How can I improve the performance of 'include()s' in PHP?

开发者 https://www.devze.com 2022-12-12 15:01 出处:网络
I have a 1.9MB PHP library that I am includ开发者_开发知识库ing at the beginning of my scripts.It contains all of my database objects, methods, etc necessary for my website.It takes 0.1s to 0.3s to in

I have a 1.9MB PHP library that I am includ开发者_开发知识库ing at the beginning of my scripts. It contains all of my database objects, methods, etc necessary for my website. It takes 0.1s to 0.3s to include it each time.

I use eAccelerator to cache the bytecode of this file. What else can I do to optimize the performance of this 'include'?


Split it into modules and load the chunks only when needed. I think that is the only way to really improve performance, I have been in the same situation and only that solved it. It's a lot of code to include, in my mind too much. I'll bet you a beer that you do not need all 1.9MB of code in every context.

0

精彩评论

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