2

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

1
  • 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
    Commented Jul 11, 2011 at 18:33

1 Answer 1

5

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.

1
  • 2
    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 :) Commented Jul 13, 2011 at 13:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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