Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an application which does heavy autoloading, meaning, that only two classes are "included" directly. For every module tha the application has (total like 14 modules), that module defines an autoloader. However, I wanted to know if is too time expensive to load all classes using autoloaders and what could I do to speed it up.

As a side note, at this point I'm not experiencing a slow application, I'm just trying to predict if it could happen.

Thanks in advance

share|improve this question
Are you using APC or another bytecode cache? If so, and as long as none of the autoload functions abuse things that call stat, autoload is rarely a performance problem. – Charles Jul 11 '11 at 18:33
up vote 4 down vote accepted

Profile the PHP code

We are terrible at determining the computer runtime of a process. While 14 modules may feel like a lot to you, keep in mind that we are terrible at judging what you're trying to do. Profiling the code now, and during future development as the project expands, is the way to go.

Aside from the PHP, you should also check other factors in your web application to ensure its speediness. YSlow is a reputable tool for doing so.

share|improve this answer
thanks for the reply. About YSlow, don't worry Im a client performance fan and follow the their rules and PageSpeed's rules to the letter! Well, mostly :) – David Conde Jul 13 '11 at 13:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.