We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Is my operation right? (Cache $loader into file or memcached)

I use registerDirs to register a lot of classes, the documentation says:

This option is not recommended in terms of performance, since Phalcon will need to perform a significant number of file stats on each folder..

So, I want to cache the loader in file or memcached, is this necessary?



7.9k

why not use registerNamespaces ? you can even autoload whole project if you are using PSR4 standard



5.4k

Thanks. My project almost complete soon. So I want to check some potential performance issues. If I cache the loader, will the performance be up?

why not use registerNamespaces ? you can even autoload whole project if you are using PSR4 standard



17.8k

Thanks. My project almost complete soon. So I want to check some potential performance issues. If I cache the loader, will the performance be up?

why not use registerNamespaces ? you can even autoload whole project if you are using PSR4 standard

Search file from disk is the short board of performance, so the best practice of optimaization is to kill the short board. cache the loader is make no sense of this.