Slow loading of resource view

Today, I resumed work on my app. I updated everything with 'composer update,' and everything is functioning correctly. However, I've noticed an extreme slowdown in one of the views. It's an infolist for a single item to which I added a relation manager and an Apex chart (I tried excluding them one at a time, but the slowness persists). I have the debug bar installed, but I can't figure out where the slowness is coming from. I'm working locally with ddev, PHP 8.2, and everything is updated to the latest release of Filament, Laravel, plugins, etc
6 Replies
CT
CT5mo ago
I would use the start_measure() and stop_measure() helper functions to figure out where the performance decrease is coming from and then take it from there. Add a bunch of those in and then compare old version vs new version
Soundmit
Soundmit5mo ago
I'm not familiar with this option; do you have any references on its usage? i've also found this bath nothing improve https://www.yellowduck.be/posts/filament-performance-when-using-laravel-debug-bar
Soundmit
Soundmit5mo ago
this is simple view

select * from `users` where `id` = 1 limit 1
1.46ms
/vendor/laravel/framework/src/Illuminate/Auth/EloquentUserProvider.php:59
db
select * from `repairshop_customers` where `repairshop_customers`.`id` = 1 limit 1
430μs
/vendor/livewire/livewire/src/Features/SupportModels/ModelSynth.php:57
db
select * from `repairshop_customers` where `repairshop_customers`.`id` = 1 limit 1
430μs
/vendor/livewire/livewire/src/Features/SupportModels/ModelSynth.php:57
db
select * from `users`
490μs
/app/Filament/Resources/CustomerResource/RelationManagers/RepairsRelationManager.php:127
db
select count(*) as aggregate from `repairshop_repairs` where `repairshop_repairs`.`customer_id` = 1 and `repairshop_repairs`.`customer_id` is not null
430μs
/vendor/filament/tables/src/Concerns/CanPaginateRecords.php:33
db
select * from `repairshop_repairs` where `repairshop_repairs`.`customer_id` = 1 and `repairshop_repairs`.`customer_id` is not null order by `repairshop_repairs`.`id` asc limit 10 offset 0
520μs
/vendor/filament/tables/src/Concerns/CanPaginateRecords.php:33
db
select * from `repairshop_technicians` where `repairshop_technicians`.`id` in (1, 3) and `repairshop_technicians`.`deleted_at` is null
330μs
/vendor/filament/tables/src/Concerns/CanPaginateRecords.php:33
db
select * from `repairshop_brands` where `repairshop_brands`.`id` in (1, 5, 9)
230μs
/vendor/filament/tables/src/Concerns/CanPaginateRecords.php:33
db
select * from `repairshop_items` where `repairshop_items`.`id` in (1, 5, 8, 9)
250μs
/vendor/filament/tables/src/Concerns/CanPaginateRecords.php:33
db
select * from `repairshop_warranties` where `repairshop_warranties`.`id` in (1, 2)
210μs
/vendor/filament/tables/src/Concerns/CanPaginateRecords.php:33
db

select * from `users` where `id` = 1 limit 1
1.46ms
/vendor/laravel/framework/src/Illuminate/Auth/EloquentUserProvider.php:59
db
select * from `repairshop_customers` where `repairshop_customers`.`id` = 1 limit 1
430μs
/vendor/livewire/livewire/src/Features/SupportModels/ModelSynth.php:57
db
select * from `repairshop_customers` where `repairshop_customers`.`id` = 1 limit 1
430μs
/vendor/livewire/livewire/src/Features/SupportModels/ModelSynth.php:57
db
select * from `users`
490μs
/app/Filament/Resources/CustomerResource/RelationManagers/RepairsRelationManager.php:127
db
select count(*) as aggregate from `repairshop_repairs` where `repairshop_repairs`.`customer_id` = 1 and `repairshop_repairs`.`customer_id` is not null
430μs
/vendor/filament/tables/src/Concerns/CanPaginateRecords.php:33
db
select * from `repairshop_repairs` where `repairshop_repairs`.`customer_id` = 1 and `repairshop_repairs`.`customer_id` is not null order by `repairshop_repairs`.`id` asc limit 10 offset 0
520μs
/vendor/filament/tables/src/Concerns/CanPaginateRecords.php:33
db
select * from `repairshop_technicians` where `repairshop_technicians`.`id` in (1, 3) and `repairshop_technicians`.`deleted_at` is null
330μs
/vendor/filament/tables/src/Concerns/CanPaginateRecords.php:33
db
select * from `repairshop_brands` where `repairshop_brands`.`id` in (1, 5, 9)
230μs
/vendor/filament/tables/src/Concerns/CanPaginateRecords.php:33
db
select * from `repairshop_items` where `repairshop_items`.`id` in (1, 5, 8, 9)
250μs
/vendor/filament/tables/src/Concerns/CanPaginateRecords.php:33
db
select * from `repairshop_warranties` where `repairshop_warranties`.`id` in (1, 2)
210μs
/vendor/filament/tables/src/Concerns/CanPaginateRecords.php:33
db
as you can see, the query are very quick the problem is in the page rendering, the relation manager appears after 7,61s
toeknee
toeknee5mo ago
Debugbar for a start should be removed when looking for performance or disable the views logging. Relation manage tends to be lazy loaded
Patrick1989
Patrick19895mo ago
debugbar is terrible for performance hehe
ChesterS
ChesterS5mo ago
just remove the views collector from debugbar and you should be fine. I find it helpful in finding runaway queries.