Filament's performance

I have some questions about Filament's performance. I'm building an admin panel to manage health information, and while it works, it's quite slow when running locally. I noticed the same issue when testing the Filament demo on my machine. After deploying it to a VPS, the performance improved, but I feel it could be even better. Has anyone faced similar issues? Any tips on optimizing performance? I noticed many requests from Livewire, and those requests are always executed when I navigate through the menu. Their duration is also quite long. I run those php artisan commands always when my docker container is generated. My goal is replicate the filament demo performance Thanks in advance!
No description
No description
No description
15 Replies
Andrew Wallo
Andrew Wallo2w ago
Slow responses/requests could be caused by many things. Any other information? Default to anywhere around 10-25 records per page on resources, try not to use a lot of widgets, optimize queries, etc.
Sydd
Sydd2w ago
did you try icons:cache .... its very important to increase filament performance
toeknee
toeknee2w ago
Also, use a debugger like Telescope and view the request that was made to /admin/paitents and look at the requests etc. It could be many reasons, like not using closures, poor indexs etc
Mohamed Ayaou
Mohamed Ayaou2w ago
run these before testing:
php artisan icons:cache
php artisan view:cache
php artisan config:cache
php artisan route:cache
php artisan event:cache
php artisan optimize
php artisan filament:cache-components
php artisan filament:optimize
php artisan opcache:compile
php artisan icons:cache
php artisan view:cache
php artisan config:cache
php artisan route:cache
php artisan event:cache
php artisan optimize
php artisan filament:cache-components
php artisan filament:optimize
php artisan opcache:compile
the last one is related with OPCache which is recommended by filament docs
Dennis Koch
Dennis Koch2w ago
Your docker container has OPCache installed? Are you on Windows?
Leiner v
Leiner vOP2w ago
Not so much information Yes, I did
Andrew Wallo
Andrew Wallo2w ago
Also make sure your PHP memory limit is set high for local development.
Leiner v
Leiner vOP2w ago
What did u mean by closures? How could I Google it?
Andrew Wallo
Andrew Wallo2w ago
Do I need to teach you how to google something?
Leiner v
Leiner vOP2w ago
I will try, I use all of them, except two Did u mean to edit memory_limit inside php.ini? Not yet, it's my first time with OPCache, I work locally on windows, but my docker container runs inside of vps with ubuntu
Andrew Wallo
Andrew Wallo2w ago
Yes Set to -1
Mark Chaney
Mark Chaney2w ago
If you are using debugbar, make sure you configure it to be friendly with livewire too or else it will really slow everything down https://daudau.cc/posts/fixing-filament-app-slowness-when-using-laravel-debug-bar
Fixing Filament app slowness when using Laravel Debugbar | Blog of ...
By default, Laravel Debugbar enables logging views, which consumes a significant amount of resources in the Filament app. Displaying all view names can potentially c
arnaudsf
arnaudsf2w ago
A massive improvement could be also to not have a request when we want to open a modal. Maybe I missed something
toeknee
toeknee2w ago
Closures are as per the docs, for example if you have a select filter or select column and are passing in options they should be using closures i.e. ->options(fn($record)=>$record->relationship->options)) instead of say: ->options(User::all()->pluck('id', 'name') Usually when performance is slow if the page table is <=25 it's down to sloppy code.
Dennis Koch
Dennis Koch2w ago
Okay. As long is it's not directly on the Windows Filesystem that should be good. OPCache is a must though I think that should be the default by now This is a help thread. Not for feature requests 😅

Did you find this page helpful?