This section includes optional tips to optimize performance when running your Filament app locally. If youâre looking for production-specific optimizations, check out Deploying to production.Documentation Index
Fetch the complete documentation index at: https://filamentphp.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Enabling OPcache
OPcache improves PHP performance by storing precompiled script bytecode in shared memory, thereby removing the need for PHP to load and parse scripts on each request. This can significantly speed up your local development environment, especially for larger applications.Checking OPcache status
To check if OPcache is enabled, run:opcache.enable => 1. If not, enable it by adding the following line to your php.ini:
Configuring OPcache settings
If youâre experiencing slow response times or suspect that OPcache is running out of space, you can adjust these parameters in yourphp.ini file:
opcache.memory_consumption: defines how much memory (in megabytes) OPcache can use to store precompiled PHP code. You can try setting this to128and adjust based on your projectâs needs.opcache.max_accelerated_files: sets the maximum number of PHP files that OPcache can cache. You can try10000as a starting point and increase if your application includes a large number of files.
Exclude your project folder from antivirus scanning
Issues with the performance of Filament, particularly on Windows, often involve Microsoft Defender. Security software, such as realtime file scanners or antivirus tools, can slow down your development environment by scanning files every time theyâre accessed. This can affect PHP execution, view rendering, and performance in general. If youâre noticing slowness, consider excluding your local project folder from realtime scanning. Tools like Microsoft Defender, or similar antivirus solutions, can be configured to skip specific directories. Check your antivirus or security software documentation for instructions on how to exclude specific folders from realtime scanning.Disabling debugging tools
Debugging tools can be very useful for local development, but they can significantly slow down your application when you arenât actively using them. Temporarily disabling these tools when you need maximum performance can make a noticeable difference in your development experience.Disabling view debugging in Laravel Herd
Laravel Herd includes a view debugging tool for macOS and Windows. It shows which views were rendered and what data was passed to them during a request. While helpful for debugging, this feature can significantly slow down your app. If youâre not actively using it, itâs best to turn it off. To disable view debugging in Herd:- Open Herd > Dumps.
- Click Settings.
- Uncheck the âViewsâ option.
Disabling Debugbar
While useful for debugging, Laravel Debugbar can slow down your application, especially on complex pages, because it collects and renders a large amount of data on each request. If youâre noticing slowness, try disabling it by adding the following line to your.env file:
Disabling Xdebug
Xdebug is a powerful tool for debugging, but it can significantly slow down performance. If you notice performance issues, check ifXdebug is installed and consider disabling it.
If Xdebug is installed but not disabled, it will still be enabled by default. If you have it installed, make sure it is explicitly disabled in your php.ini file: