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 43267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:28:06+00:00 2026-05-10T15:28:06+00:00

For our online game, we have written tons of PHP classes and functions grouped

  • 0

For our online game, we have written tons of PHP classes and functions grouped by theme in files and then folders. In the end, we have now all our backend code (logic & DB access layers) in a set of files that we call libs and we include our libs in our GUI (web pages, presentation layer) using include_once(‘pathtolib/file.inc’).

The problem is that we have been lazy with inclusions and most include statements are made inside our libs file resulting that from each webpage, each time we include any libs file, we actually load the entire libs, file by file.

This has a significant impact on the performance. Therefore What would be the best solution ?

  • Remove all include statements from the libs file and only call the necessary one from the web pages ?
  • Do something else ?

Server uses a classic LAMP stack (PHP5).

EDIT: We have a mix of simple functions (legacy reason and the majority of the code) and classes. So autoload will not be enough.

  • 1 1 Answer
  • 2 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. 2026-05-10T15:28:07+00:00Added an answer on May 10, 2026 at 3:28 pm
    • Manage all includes manually, only where needed
    • Set your include_path to only where it has to be, the default is something like .:/usr/lib/pear/:/usr/lib/php, point it only at where it has to be, php.net/set_include_path
    • Don’t use autoload, it’s slow and makes APC and equivalent caches jobs a lot harder
    • You can turn off the ‘stat’-operation in APC, but then you have to clear the cache manually every time you update the files
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

some of our customers have Quick book online and some of our customers have
We have a few 100 users logging in via FTP and uploading files. Our
I have the following file dumped daily into one of our online directories: dat-part2-489359-43535-toward.txt
We have this API to our ordering system in our Call-Center, that our online-ordering
Ok so i have our online ordering going, its a module that i have
I have sales data from some our online listings. I randomly priced the same
We have to prepare new search functionality in our online store. I was wondering
So far most of our clients (online retailers and banks) have been reticent of
Okay, so we have to store our clients` private medical records online and also
I have been integrating datatables with our online application and while I'm overall impressed

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.