List pages performance
I'm paginating to 25 items a large table (>5k items) and the performance it's terrible. 5 seconds on my localhost with opcache enabled.
Memory is also really high. I've tried to override the getTableQuery function in the List resource file to select only the fields I'm showing in the table, but has no effect on the memory used.
What can I do to improve this?
24 Replies
that is abnormally high
in the demo it only uses 10% of memory and 2% of the time
but we cant debug this for you
how many table columns do you have? what is the response time and memory usage for a non-filament page
8 columns
and a page on the frontend behaves differently
how about an admin page without tables
I know you can't debug this for me, I'm just asking if there any hint you can give
that's another weird thing that signals I've something wrong... If I enter the edit page of one of those list elements shows 4Mb of memory and under 500ms, but for a brief moment before loading, the debugbar shows that hydrates all the elements on that table
try removing stuff one by one until you work out what causes it
in the form function, you mean?
in the table function of the slow page
leaving just the id in the table takes 2.19s and 34mb of memory
okay well its not that then
must be something else on the page or resource
or in a service provider
or middleware
yes, seems that some code in the AppServiceProvider is affecting this!
removing it goes down to 12Mb
great
that sounds more reasonable
It's a view::composer added there to allow all the frontend pages to have a shared menu
I wasn't aware that that can mess this!
add it in a middleware only to your frontend routes
hmm, ok
will try that
and about the moment that debugbar shows all the elements in models tab?... do you have any clue about that behaviour?
i dont know but i think its on your end
ok, thanks!
I've discovered what it was! I was using the ->options() function in a relationship select
Interesting
make sure to wrap the options in a
fn () =>
I was using fn
->options(fn() => Activity::getOptions()),
when I've removed that, that weird behaviour from the screenshot, has ended
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
everyone who has reported this issue has later decided its not filament
so check your service providers and middleware etc
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View