Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

feature like composer dump-autoload

Phalcon::Loader is becoming the bottleneck in our application due to a lot of classes (namespaces) that needed to scan. Is there a plugin or a way in Phalcon to have something similar with composer's "dump-autoload --classmap-authoritative" ?

Thanks



107.2k
Accepted
answer

Just enable opcache.

If Loader is your only bottleneck, you must have way too many external dependencies. I often see projects with dozen of external libs where people just use the way they're used to from other frameworks. The end result - you're not using Phalcon but Laravel or Symfony framework (performance wise).

OPcache should be your only out of the box solution. Phalcon loader when used properly is the fastest available loader in the PHP world (alongside SPL autoload). Just avoid any includes / requires and use namespaces or classes strategy.

Thanks guys. Yes opcache is the solution here