Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6033795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:32:09+00:00 2026-05-23T05:32:09+00:00

Question pretty much states it all, I am working on a large project where

  • 0

Question pretty much states it all, I am working on a large project where most calls to php include() between 100 and 150 files. On average the time php takes is between 150 and 300 ms. I’m wondering how much of this is due to including PHP scripts? I’ve been thinking about running a script that checks most accessed files for particular calls and merge them into one file to speed things up, but for all I know this has zero impact.

I should note that I use APC, I’m not fully aware of what APC does in the background, but I would imagine it might already cache my files somehow so the amount of files doens’t really make a big difference?

Would appreciate any input on the subject.

Of course, 300ms isnt much, but if I can bring it down to say, 100 or even 50ms, thats a significant boost.

Edit:

To clarify I am talking about file loading by php include / require.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T05:32:09+00:00Added an answer on May 23, 2026 at 5:32 am

    File loading is a tricky thing. As others have said, the only sure fire way to tell is to do some benchmarks. However, here are some general rules that apply only to PHP loading, not files with fopen:

    • APC will store its opcode cache in shared memory so you will take a hit on the first load but not subsequent loads.
    • include and include_once (and their require cousins) are actually quite heavy. Here are some tips to improve their speed:
      • Use absolute paths to your files (avoid relative paths like ../foo.php)
      • Both the _once functions need to check to make sure that the file wasn’t also included via a symbolic link since a symbolic link can produce multiple paths to the same file. This is extremely expensive. (see next point)
    • It is much cheaper to load only the files you need than to call include. Make use of auto-loaders to only load classes when they are needed.
    • Local disks will almost always be a better bet than networked storage. When possible, if you have multiple servers, keep copies of the source code on each server. It means you need to update multiple places during a release but it is worth the effort in performance.

    Overall it is dependent on your hard disk speed. But compared to not loading a file at all or loading it from RAM, file loading is incredible slow.

    I hope that helped.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The title of the question pretty much states the problem. Is it possible?
Pretty much what the question says. What's the difference between the two classes of
The question pretty much says it all, I've been looking around for an answer
The question pretty much says it all, I've tried setting the backcolour to transparent
The title pretty much states my question. I have a view (say, Action1 )
question pretty much says it all. i'd like to look at the code in
Question pretty much says it all. You can read entity association here , but
The question pretty much says it all. I'd like to be able to search
Question pretty much says it all, though explicitly I'm looking for the things I
As the question pretty much sums up, I'm doing a presentation on some of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.